001    /**
002     * Copyright (c) 2000-2013 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portlet.shopping.model.impl;
016    
017    import com.liferay.portal.kernel.util.StringBundler;
018    import com.liferay.portal.kernel.util.StringPool;
019    import com.liferay.portal.model.CacheModel;
020    
021    import com.liferay.portlet.shopping.model.ShoppingOrder;
022    
023    import java.io.Serializable;
024    
025    import java.util.Date;
026    
027    /**
028     * The cache model class for representing ShoppingOrder in entity cache.
029     *
030     * @author Brian Wing Shun Chan
031     * @see ShoppingOrder
032     * @generated
033     */
034    public class ShoppingOrderCacheModel implements CacheModel<ShoppingOrder>,
035            Serializable {
036            @Override
037            public String toString() {
038                    StringBundler sb = new StringBundler(103);
039    
040                    sb.append("{orderId=");
041                    sb.append(orderId);
042                    sb.append(", groupId=");
043                    sb.append(groupId);
044                    sb.append(", companyId=");
045                    sb.append(companyId);
046                    sb.append(", userId=");
047                    sb.append(userId);
048                    sb.append(", userName=");
049                    sb.append(userName);
050                    sb.append(", createDate=");
051                    sb.append(createDate);
052                    sb.append(", modifiedDate=");
053                    sb.append(modifiedDate);
054                    sb.append(", number=");
055                    sb.append(number);
056                    sb.append(", tax=");
057                    sb.append(tax);
058                    sb.append(", shipping=");
059                    sb.append(shipping);
060                    sb.append(", altShipping=");
061                    sb.append(altShipping);
062                    sb.append(", requiresShipping=");
063                    sb.append(requiresShipping);
064                    sb.append(", insure=");
065                    sb.append(insure);
066                    sb.append(", insurance=");
067                    sb.append(insurance);
068                    sb.append(", couponCodes=");
069                    sb.append(couponCodes);
070                    sb.append(", couponDiscount=");
071                    sb.append(couponDiscount);
072                    sb.append(", billingFirstName=");
073                    sb.append(billingFirstName);
074                    sb.append(", billingLastName=");
075                    sb.append(billingLastName);
076                    sb.append(", billingEmailAddress=");
077                    sb.append(billingEmailAddress);
078                    sb.append(", billingCompany=");
079                    sb.append(billingCompany);
080                    sb.append(", billingStreet=");
081                    sb.append(billingStreet);
082                    sb.append(", billingCity=");
083                    sb.append(billingCity);
084                    sb.append(", billingState=");
085                    sb.append(billingState);
086                    sb.append(", billingZip=");
087                    sb.append(billingZip);
088                    sb.append(", billingCountry=");
089                    sb.append(billingCountry);
090                    sb.append(", billingPhone=");
091                    sb.append(billingPhone);
092                    sb.append(", shipToBilling=");
093                    sb.append(shipToBilling);
094                    sb.append(", shippingFirstName=");
095                    sb.append(shippingFirstName);
096                    sb.append(", shippingLastName=");
097                    sb.append(shippingLastName);
098                    sb.append(", shippingEmailAddress=");
099                    sb.append(shippingEmailAddress);
100                    sb.append(", shippingCompany=");
101                    sb.append(shippingCompany);
102                    sb.append(", shippingStreet=");
103                    sb.append(shippingStreet);
104                    sb.append(", shippingCity=");
105                    sb.append(shippingCity);
106                    sb.append(", shippingState=");
107                    sb.append(shippingState);
108                    sb.append(", shippingZip=");
109                    sb.append(shippingZip);
110                    sb.append(", shippingCountry=");
111                    sb.append(shippingCountry);
112                    sb.append(", shippingPhone=");
113                    sb.append(shippingPhone);
114                    sb.append(", ccName=");
115                    sb.append(ccName);
116                    sb.append(", ccType=");
117                    sb.append(ccType);
118                    sb.append(", ccNumber=");
119                    sb.append(ccNumber);
120                    sb.append(", ccExpMonth=");
121                    sb.append(ccExpMonth);
122                    sb.append(", ccExpYear=");
123                    sb.append(ccExpYear);
124                    sb.append(", ccVerNumber=");
125                    sb.append(ccVerNumber);
126                    sb.append(", comments=");
127                    sb.append(comments);
128                    sb.append(", ppTxnId=");
129                    sb.append(ppTxnId);
130                    sb.append(", ppPaymentStatus=");
131                    sb.append(ppPaymentStatus);
132                    sb.append(", ppPaymentGross=");
133                    sb.append(ppPaymentGross);
134                    sb.append(", ppReceiverEmail=");
135                    sb.append(ppReceiverEmail);
136                    sb.append(", ppPayerEmail=");
137                    sb.append(ppPayerEmail);
138                    sb.append(", sendOrderEmail=");
139                    sb.append(sendOrderEmail);
140                    sb.append(", sendShippingEmail=");
141                    sb.append(sendShippingEmail);
142                    sb.append("}");
143    
144                    return sb.toString();
145            }
146    
147            public ShoppingOrder toEntityModel() {
148                    ShoppingOrderImpl shoppingOrderImpl = new ShoppingOrderImpl();
149    
150                    shoppingOrderImpl.setOrderId(orderId);
151                    shoppingOrderImpl.setGroupId(groupId);
152                    shoppingOrderImpl.setCompanyId(companyId);
153                    shoppingOrderImpl.setUserId(userId);
154    
155                    if (userName == null) {
156                            shoppingOrderImpl.setUserName(StringPool.BLANK);
157                    }
158                    else {
159                            shoppingOrderImpl.setUserName(userName);
160                    }
161    
162                    if (createDate == Long.MIN_VALUE) {
163                            shoppingOrderImpl.setCreateDate(null);
164                    }
165                    else {
166                            shoppingOrderImpl.setCreateDate(new Date(createDate));
167                    }
168    
169                    if (modifiedDate == Long.MIN_VALUE) {
170                            shoppingOrderImpl.setModifiedDate(null);
171                    }
172                    else {
173                            shoppingOrderImpl.setModifiedDate(new Date(modifiedDate));
174                    }
175    
176                    if (number == null) {
177                            shoppingOrderImpl.setNumber(StringPool.BLANK);
178                    }
179                    else {
180                            shoppingOrderImpl.setNumber(number);
181                    }
182    
183                    shoppingOrderImpl.setTax(tax);
184                    shoppingOrderImpl.setShipping(shipping);
185    
186                    if (altShipping == null) {
187                            shoppingOrderImpl.setAltShipping(StringPool.BLANK);
188                    }
189                    else {
190                            shoppingOrderImpl.setAltShipping(altShipping);
191                    }
192    
193                    shoppingOrderImpl.setRequiresShipping(requiresShipping);
194                    shoppingOrderImpl.setInsure(insure);
195                    shoppingOrderImpl.setInsurance(insurance);
196    
197                    if (couponCodes == null) {
198                            shoppingOrderImpl.setCouponCodes(StringPool.BLANK);
199                    }
200                    else {
201                            shoppingOrderImpl.setCouponCodes(couponCodes);
202                    }
203    
204                    shoppingOrderImpl.setCouponDiscount(couponDiscount);
205    
206                    if (billingFirstName == null) {
207                            shoppingOrderImpl.setBillingFirstName(StringPool.BLANK);
208                    }
209                    else {
210                            shoppingOrderImpl.setBillingFirstName(billingFirstName);
211                    }
212    
213                    if (billingLastName == null) {
214                            shoppingOrderImpl.setBillingLastName(StringPool.BLANK);
215                    }
216                    else {
217                            shoppingOrderImpl.setBillingLastName(billingLastName);
218                    }
219    
220                    if (billingEmailAddress == null) {
221                            shoppingOrderImpl.setBillingEmailAddress(StringPool.BLANK);
222                    }
223                    else {
224                            shoppingOrderImpl.setBillingEmailAddress(billingEmailAddress);
225                    }
226    
227                    if (billingCompany == null) {
228                            shoppingOrderImpl.setBillingCompany(StringPool.BLANK);
229                    }
230                    else {
231                            shoppingOrderImpl.setBillingCompany(billingCompany);
232                    }
233    
234                    if (billingStreet == null) {
235                            shoppingOrderImpl.setBillingStreet(StringPool.BLANK);
236                    }
237                    else {
238                            shoppingOrderImpl.setBillingStreet(billingStreet);
239                    }
240    
241                    if (billingCity == null) {
242                            shoppingOrderImpl.setBillingCity(StringPool.BLANK);
243                    }
244                    else {
245                            shoppingOrderImpl.setBillingCity(billingCity);
246                    }
247    
248                    if (billingState == null) {
249                            shoppingOrderImpl.setBillingState(StringPool.BLANK);
250                    }
251                    else {
252                            shoppingOrderImpl.setBillingState(billingState);
253                    }
254    
255                    if (billingZip == null) {
256                            shoppingOrderImpl.setBillingZip(StringPool.BLANK);
257                    }
258                    else {
259                            shoppingOrderImpl.setBillingZip(billingZip);
260                    }
261    
262                    if (billingCountry == null) {
263                            shoppingOrderImpl.setBillingCountry(StringPool.BLANK);
264                    }
265                    else {
266                            shoppingOrderImpl.setBillingCountry(billingCountry);
267                    }
268    
269                    if (billingPhone == null) {
270                            shoppingOrderImpl.setBillingPhone(StringPool.BLANK);
271                    }
272                    else {
273                            shoppingOrderImpl.setBillingPhone(billingPhone);
274                    }
275    
276                    shoppingOrderImpl.setShipToBilling(shipToBilling);
277    
278                    if (shippingFirstName == null) {
279                            shoppingOrderImpl.setShippingFirstName(StringPool.BLANK);
280                    }
281                    else {
282                            shoppingOrderImpl.setShippingFirstName(shippingFirstName);
283                    }
284    
285                    if (shippingLastName == null) {
286                            shoppingOrderImpl.setShippingLastName(StringPool.BLANK);
287                    }
288                    else {
289                            shoppingOrderImpl.setShippingLastName(shippingLastName);
290                    }
291    
292                    if (shippingEmailAddress == null) {
293                            shoppingOrderImpl.setShippingEmailAddress(StringPool.BLANK);
294                    }
295                    else {
296                            shoppingOrderImpl.setShippingEmailAddress(shippingEmailAddress);
297                    }
298    
299                    if (shippingCompany == null) {
300                            shoppingOrderImpl.setShippingCompany(StringPool.BLANK);
301                    }
302                    else {
303                            shoppingOrderImpl.setShippingCompany(shippingCompany);
304                    }
305    
306                    if (shippingStreet == null) {
307                            shoppingOrderImpl.setShippingStreet(StringPool.BLANK);
308                    }
309                    else {
310                            shoppingOrderImpl.setShippingStreet(shippingStreet);
311                    }
312    
313                    if (shippingCity == null) {
314                            shoppingOrderImpl.setShippingCity(StringPool.BLANK);
315                    }
316                    else {
317                            shoppingOrderImpl.setShippingCity(shippingCity);
318                    }
319    
320                    if (shippingState == null) {
321                            shoppingOrderImpl.setShippingState(StringPool.BLANK);
322                    }
323                    else {
324                            shoppingOrderImpl.setShippingState(shippingState);
325                    }
326    
327                    if (shippingZip == null) {
328                            shoppingOrderImpl.setShippingZip(StringPool.BLANK);
329                    }
330                    else {
331                            shoppingOrderImpl.setShippingZip(shippingZip);
332                    }
333    
334                    if (shippingCountry == null) {
335                            shoppingOrderImpl.setShippingCountry(StringPool.BLANK);
336                    }
337                    else {
338                            shoppingOrderImpl.setShippingCountry(shippingCountry);
339                    }
340    
341                    if (shippingPhone == null) {
342                            shoppingOrderImpl.setShippingPhone(StringPool.BLANK);
343                    }
344                    else {
345                            shoppingOrderImpl.setShippingPhone(shippingPhone);
346                    }
347    
348                    if (ccName == null) {
349                            shoppingOrderImpl.setCcName(StringPool.BLANK);
350                    }
351                    else {
352                            shoppingOrderImpl.setCcName(ccName);
353                    }
354    
355                    if (ccType == null) {
356                            shoppingOrderImpl.setCcType(StringPool.BLANK);
357                    }
358                    else {
359                            shoppingOrderImpl.setCcType(ccType);
360                    }
361    
362                    if (ccNumber == null) {
363                            shoppingOrderImpl.setCcNumber(StringPool.BLANK);
364                    }
365                    else {
366                            shoppingOrderImpl.setCcNumber(ccNumber);
367                    }
368    
369                    shoppingOrderImpl.setCcExpMonth(ccExpMonth);
370                    shoppingOrderImpl.setCcExpYear(ccExpYear);
371    
372                    if (ccVerNumber == null) {
373                            shoppingOrderImpl.setCcVerNumber(StringPool.BLANK);
374                    }
375                    else {
376                            shoppingOrderImpl.setCcVerNumber(ccVerNumber);
377                    }
378    
379                    if (comments == null) {
380                            shoppingOrderImpl.setComments(StringPool.BLANK);
381                    }
382                    else {
383                            shoppingOrderImpl.setComments(comments);
384                    }
385    
386                    if (ppTxnId == null) {
387                            shoppingOrderImpl.setPpTxnId(StringPool.BLANK);
388                    }
389                    else {
390                            shoppingOrderImpl.setPpTxnId(ppTxnId);
391                    }
392    
393                    if (ppPaymentStatus == null) {
394                            shoppingOrderImpl.setPpPaymentStatus(StringPool.BLANK);
395                    }
396                    else {
397                            shoppingOrderImpl.setPpPaymentStatus(ppPaymentStatus);
398                    }
399    
400                    shoppingOrderImpl.setPpPaymentGross(ppPaymentGross);
401    
402                    if (ppReceiverEmail == null) {
403                            shoppingOrderImpl.setPpReceiverEmail(StringPool.BLANK);
404                    }
405                    else {
406                            shoppingOrderImpl.setPpReceiverEmail(ppReceiverEmail);
407                    }
408    
409                    if (ppPayerEmail == null) {
410                            shoppingOrderImpl.setPpPayerEmail(StringPool.BLANK);
411                    }
412                    else {
413                            shoppingOrderImpl.setPpPayerEmail(ppPayerEmail);
414                    }
415    
416                    shoppingOrderImpl.setSendOrderEmail(sendOrderEmail);
417                    shoppingOrderImpl.setSendShippingEmail(sendShippingEmail);
418    
419                    shoppingOrderImpl.resetOriginalValues();
420    
421                    return shoppingOrderImpl;
422            }
423    
424            public long orderId;
425            public long groupId;
426            public long companyId;
427            public long userId;
428            public String userName;
429            public long createDate;
430            public long modifiedDate;
431            public String number;
432            public double tax;
433            public double shipping;
434            public String altShipping;
435            public boolean requiresShipping;
436            public boolean insure;
437            public double insurance;
438            public String couponCodes;
439            public double couponDiscount;
440            public String billingFirstName;
441            public String billingLastName;
442            public String billingEmailAddress;
443            public String billingCompany;
444            public String billingStreet;
445            public String billingCity;
446            public String billingState;
447            public String billingZip;
448            public String billingCountry;
449            public String billingPhone;
450            public boolean shipToBilling;
451            public String shippingFirstName;
452            public String shippingLastName;
453            public String shippingEmailAddress;
454            public String shippingCompany;
455            public String shippingStreet;
456            public String shippingCity;
457            public String shippingState;
458            public String shippingZip;
459            public String shippingCountry;
460            public String shippingPhone;
461            public String ccName;
462            public String ccType;
463            public String ccNumber;
464            public int ccExpMonth;
465            public int ccExpYear;
466            public String ccVerNumber;
467            public String comments;
468            public String ppTxnId;
469            public String ppPaymentStatus;
470            public double ppPaymentGross;
471            public String ppReceiverEmail;
472            public String ppPayerEmail;
473            public boolean sendOrderEmail;
474            public boolean sendShippingEmail;
475    }