1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    * Permission is hereby granted, free of charge, to any person obtaining a copy
5    * of this software and associated documentation files (the "Software"), to deal
6    * in the Software without restriction, including without limitation the rights
7    * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8    * copies of the Software, and to permit persons to whom the Software is
9    * furnished to do so, subject to the following conditions:
10   *
11   * The above copyright notice and this permission notice shall be included in
12   * all copies or substantial portions of the Software.
13   *
14   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20   * SOFTWARE.
21   */
22  
23  package com.liferay.portlet.shopping.model.impl;
24  
25  import com.liferay.portal.kernel.bean.ReadOnlyBeanHandler;
26  import com.liferay.portal.kernel.util.GetterUtil;
27  import com.liferay.portal.kernel.util.HtmlUtil;
28  import com.liferay.portal.model.impl.BaseModelImpl;
29  
30  import com.liferay.portlet.expando.model.ExpandoBridge;
31  import com.liferay.portlet.expando.model.impl.ExpandoBridgeImpl;
32  import com.liferay.portlet.shopping.model.ShoppingItem;
33  import com.liferay.portlet.shopping.model.ShoppingItemSoap;
34  
35  import java.io.Serializable;
36  
37  import java.lang.reflect.Proxy;
38  
39  import java.sql.Types;
40  
41  import java.util.ArrayList;
42  import java.util.Date;
43  import java.util.List;
44  
45  /**
46   * <a href="ShoppingItemModelImpl.java.html"><b><i>View Source</i></b></a>
47   *
48   * <p>
49   * ServiceBuilder generated this class. Modifications in this class will be
50   * overwritten the next time is generated.
51   * </p>
52   *
53   * <p>
54   * This class is a model that represents the <code>ShoppingItem</code> table
55   * in the database.
56   * </p>
57   *
58   * @author Brian Wing Shun Chan
59   *
60   * @see com.liferay.portlet.shopping.model.ShoppingItem
61   * @see com.liferay.portlet.shopping.model.ShoppingItemModel
62   * @see com.liferay.portlet.shopping.model.impl.ShoppingItemImpl
63   *
64   */
65  public class ShoppingItemModelImpl extends BaseModelImpl {
66      public static final String TABLE_NAME = "ShoppingItem";
67      public static final Object[][] TABLE_COLUMNS = {
68              { "itemId", new Integer(Types.BIGINT) },
69              
70  
71              { "companyId", new Integer(Types.BIGINT) },
72              
73  
74              { "userId", new Integer(Types.BIGINT) },
75              
76  
77              { "userName", new Integer(Types.VARCHAR) },
78              
79  
80              { "createDate", new Integer(Types.TIMESTAMP) },
81              
82  
83              { "modifiedDate", new Integer(Types.TIMESTAMP) },
84              
85  
86              { "categoryId", new Integer(Types.BIGINT) },
87              
88  
89              { "sku", new Integer(Types.VARCHAR) },
90              
91  
92              { "name", new Integer(Types.VARCHAR) },
93              
94  
95              { "description", new Integer(Types.VARCHAR) },
96              
97  
98              { "properties", new Integer(Types.VARCHAR) },
99              
100 
101             { "fields_", new Integer(Types.BOOLEAN) },
102             
103 
104             { "fieldsQuantities", new Integer(Types.VARCHAR) },
105             
106 
107             { "minQuantity", new Integer(Types.INTEGER) },
108             
109 
110             { "maxQuantity", new Integer(Types.INTEGER) },
111             
112 
113             { "price", new Integer(Types.DOUBLE) },
114             
115 
116             { "discount", new Integer(Types.DOUBLE) },
117             
118 
119             { "taxable", new Integer(Types.BOOLEAN) },
120             
121 
122             { "shipping", new Integer(Types.DOUBLE) },
123             
124 
125             { "useShippingFormula", new Integer(Types.BOOLEAN) },
126             
127 
128             { "requiresShipping", new Integer(Types.BOOLEAN) },
129             
130 
131             { "stockQuantity", new Integer(Types.INTEGER) },
132             
133 
134             { "featured_", new Integer(Types.BOOLEAN) },
135             
136 
137             { "sale_", new Integer(Types.BOOLEAN) },
138             
139 
140             { "smallImage", new Integer(Types.BOOLEAN) },
141             
142 
143             { "smallImageId", new Integer(Types.BIGINT) },
144             
145 
146             { "smallImageURL", new Integer(Types.VARCHAR) },
147             
148 
149             { "mediumImage", new Integer(Types.BOOLEAN) },
150             
151 
152             { "mediumImageId", new Integer(Types.BIGINT) },
153             
154 
155             { "mediumImageURL", new Integer(Types.VARCHAR) },
156             
157 
158             { "largeImage", new Integer(Types.BOOLEAN) },
159             
160 
161             { "largeImageId", new Integer(Types.BIGINT) },
162             
163 
164             { "largeImageURL", new Integer(Types.VARCHAR) }
165         };
166     public static final String TABLE_SQL_CREATE = "create table ShoppingItem (itemId LONG not null primary key,companyId LONG,userId LONG,userName VARCHAR(75) null,createDate DATE null,modifiedDate DATE null,categoryId LONG,sku VARCHAR(75) null,name VARCHAR(200) null,description STRING null,properties STRING null,fields_ BOOLEAN,fieldsQuantities STRING null,minQuantity INTEGER,maxQuantity INTEGER,price DOUBLE,discount DOUBLE,taxable BOOLEAN,shipping DOUBLE,useShippingFormula BOOLEAN,requiresShipping BOOLEAN,stockQuantity INTEGER,featured_ BOOLEAN,sale_ BOOLEAN,smallImage BOOLEAN,smallImageId LONG,smallImageURL VARCHAR(75) null,mediumImage BOOLEAN,mediumImageId LONG,mediumImageURL VARCHAR(75) null,largeImage BOOLEAN,largeImageId LONG,largeImageURL VARCHAR(75) null)";
167     public static final String TABLE_SQL_DROP = "drop table ShoppingItem";
168     public static final String DATA_SOURCE = "liferayDataSource";
169     public static final String SESSION_FACTORY = "liferaySessionFactory";
170     public static final String TX_MANAGER = "liferayTransactionManager";
171     public static final boolean CACHE_ENABLED = GetterUtil.getBoolean(com.liferay.portal.util.PropsUtil.get(
172                 "value.object.finder.cache.enabled.com.liferay.portlet.shopping.model.ShoppingItem"),
173             true);
174 
175     public static ShoppingItem toModel(ShoppingItemSoap soapModel) {
176         ShoppingItem model = new ShoppingItemImpl();
177 
178         model.setItemId(soapModel.getItemId());
179         model.setCompanyId(soapModel.getCompanyId());
180         model.setUserId(soapModel.getUserId());
181         model.setUserName(soapModel.getUserName());
182         model.setCreateDate(soapModel.getCreateDate());
183         model.setModifiedDate(soapModel.getModifiedDate());
184         model.setCategoryId(soapModel.getCategoryId());
185         model.setSku(soapModel.getSku());
186         model.setName(soapModel.getName());
187         model.setDescription(soapModel.getDescription());
188         model.setProperties(soapModel.getProperties());
189         model.setFields(soapModel.getFields());
190         model.setFieldsQuantities(soapModel.getFieldsQuantities());
191         model.setMinQuantity(soapModel.getMinQuantity());
192         model.setMaxQuantity(soapModel.getMaxQuantity());
193         model.setPrice(soapModel.getPrice());
194         model.setDiscount(soapModel.getDiscount());
195         model.setTaxable(soapModel.getTaxable());
196         model.setShipping(soapModel.getShipping());
197         model.setUseShippingFormula(soapModel.getUseShippingFormula());
198         model.setRequiresShipping(soapModel.getRequiresShipping());
199         model.setStockQuantity(soapModel.getStockQuantity());
200         model.setFeatured(soapModel.getFeatured());
201         model.setSale(soapModel.getSale());
202         model.setSmallImage(soapModel.getSmallImage());
203         model.setSmallImageId(soapModel.getSmallImageId());
204         model.setSmallImageURL(soapModel.getSmallImageURL());
205         model.setMediumImage(soapModel.getMediumImage());
206         model.setMediumImageId(soapModel.getMediumImageId());
207         model.setMediumImageURL(soapModel.getMediumImageURL());
208         model.setLargeImage(soapModel.getLargeImage());
209         model.setLargeImageId(soapModel.getLargeImageId());
210         model.setLargeImageURL(soapModel.getLargeImageURL());
211 
212         return model;
213     }
214 
215     public static List<ShoppingItem> toModels(ShoppingItemSoap[] soapModels) {
216         List<ShoppingItem> models = new ArrayList<ShoppingItem>(soapModels.length);
217 
218         for (ShoppingItemSoap soapModel : soapModels) {
219             models.add(toModel(soapModel));
220         }
221 
222         return models;
223     }
224 
225     public static final long LOCK_EXPIRATION_TIME = GetterUtil.getLong(com.liferay.portal.util.PropsUtil.get(
226                 "lock.expiration.time.com.liferay.portlet.shopping.model.ShoppingItem"));
227 
228     public ShoppingItemModelImpl() {
229     }
230 
231     public long getPrimaryKey() {
232         return _itemId;
233     }
234 
235     public void setPrimaryKey(long pk) {
236         setItemId(pk);
237     }
238 
239     public Serializable getPrimaryKeyObj() {
240         return new Long(_itemId);
241     }
242 
243     public long getItemId() {
244         return _itemId;
245     }
246 
247     public void setItemId(long itemId) {
248         if (itemId != _itemId) {
249             _itemId = itemId;
250         }
251     }
252 
253     public long getCompanyId() {
254         return _companyId;
255     }
256 
257     public void setCompanyId(long companyId) {
258         if (companyId != _companyId) {
259             _companyId = companyId;
260         }
261     }
262 
263     public long getUserId() {
264         return _userId;
265     }
266 
267     public void setUserId(long userId) {
268         if (userId != _userId) {
269             _userId = userId;
270         }
271     }
272 
273     public String getUserName() {
274         return GetterUtil.getString(_userName);
275     }
276 
277     public void setUserName(String userName) {
278         if (((userName == null) && (_userName != null)) ||
279                 ((userName != null) && (_userName == null)) ||
280                 ((userName != null) && (_userName != null) &&
281                 !userName.equals(_userName))) {
282             _userName = userName;
283         }
284     }
285 
286     public Date getCreateDate() {
287         return _createDate;
288     }
289 
290     public void setCreateDate(Date createDate) {
291         if (((createDate == null) && (_createDate != null)) ||
292                 ((createDate != null) && (_createDate == null)) ||
293                 ((createDate != null) && (_createDate != null) &&
294                 !createDate.equals(_createDate))) {
295             _createDate = createDate;
296         }
297     }
298 
299     public Date getModifiedDate() {
300         return _modifiedDate;
301     }
302 
303     public void setModifiedDate(Date modifiedDate) {
304         if (((modifiedDate == null) && (_modifiedDate != null)) ||
305                 ((modifiedDate != null) && (_modifiedDate == null)) ||
306                 ((modifiedDate != null) && (_modifiedDate != null) &&
307                 !modifiedDate.equals(_modifiedDate))) {
308             _modifiedDate = modifiedDate;
309         }
310     }
311 
312     public long getCategoryId() {
313         return _categoryId;
314     }
315 
316     public void setCategoryId(long categoryId) {
317         if (categoryId != _categoryId) {
318             _categoryId = categoryId;
319         }
320     }
321 
322     public String getSku() {
323         return GetterUtil.getString(_sku);
324     }
325 
326     public void setSku(String sku) {
327         if (((sku == null) && (_sku != null)) ||
328                 ((sku != null) && (_sku == null)) ||
329                 ((sku != null) && (_sku != null) && !sku.equals(_sku))) {
330             _sku = sku;
331         }
332     }
333 
334     public String getName() {
335         return GetterUtil.getString(_name);
336     }
337 
338     public void setName(String name) {
339         if (((name == null) && (_name != null)) ||
340                 ((name != null) && (_name == null)) ||
341                 ((name != null) && (_name != null) && !name.equals(_name))) {
342             _name = name;
343         }
344     }
345 
346     public String getDescription() {
347         return GetterUtil.getString(_description);
348     }
349 
350     public void setDescription(String description) {
351         if (((description == null) && (_description != null)) ||
352                 ((description != null) && (_description == null)) ||
353                 ((description != null) && (_description != null) &&
354                 !description.equals(_description))) {
355             _description = description;
356         }
357     }
358 
359     public String getProperties() {
360         return GetterUtil.getString(_properties);
361     }
362 
363     public void setProperties(String properties) {
364         if (((properties == null) && (_properties != null)) ||
365                 ((properties != null) && (_properties == null)) ||
366                 ((properties != null) && (_properties != null) &&
367                 !properties.equals(_properties))) {
368             _properties = properties;
369         }
370     }
371 
372     public boolean getFields() {
373         return _fields;
374     }
375 
376     public boolean isFields() {
377         return _fields;
378     }
379 
380     public void setFields(boolean fields) {
381         if (fields != _fields) {
382             _fields = fields;
383         }
384     }
385 
386     public String getFieldsQuantities() {
387         return GetterUtil.getString(_fieldsQuantities);
388     }
389 
390     public void setFieldsQuantities(String fieldsQuantities) {
391         if (((fieldsQuantities == null) && (_fieldsQuantities != null)) ||
392                 ((fieldsQuantities != null) && (_fieldsQuantities == null)) ||
393                 ((fieldsQuantities != null) && (_fieldsQuantities != null) &&
394                 !fieldsQuantities.equals(_fieldsQuantities))) {
395             _fieldsQuantities = fieldsQuantities;
396         }
397     }
398 
399     public int getMinQuantity() {
400         return _minQuantity;
401     }
402 
403     public void setMinQuantity(int minQuantity) {
404         if (minQuantity != _minQuantity) {
405             _minQuantity = minQuantity;
406         }
407     }
408 
409     public int getMaxQuantity() {
410         return _maxQuantity;
411     }
412 
413     public void setMaxQuantity(int maxQuantity) {
414         if (maxQuantity != _maxQuantity) {
415             _maxQuantity = maxQuantity;
416         }
417     }
418 
419     public double getPrice() {
420         return _price;
421     }
422 
423     public void setPrice(double price) {
424         if (price != _price) {
425             _price = price;
426         }
427     }
428 
429     public double getDiscount() {
430         return _discount;
431     }
432 
433     public void setDiscount(double discount) {
434         if (discount != _discount) {
435             _discount = discount;
436         }
437     }
438 
439     public boolean getTaxable() {
440         return _taxable;
441     }
442 
443     public boolean isTaxable() {
444         return _taxable;
445     }
446 
447     public void setTaxable(boolean taxable) {
448         if (taxable != _taxable) {
449             _taxable = taxable;
450         }
451     }
452 
453     public double getShipping() {
454         return _shipping;
455     }
456 
457     public void setShipping(double shipping) {
458         if (shipping != _shipping) {
459             _shipping = shipping;
460         }
461     }
462 
463     public boolean getUseShippingFormula() {
464         return _useShippingFormula;
465     }
466 
467     public boolean isUseShippingFormula() {
468         return _useShippingFormula;
469     }
470 
471     public void setUseShippingFormula(boolean useShippingFormula) {
472         if (useShippingFormula != _useShippingFormula) {
473             _useShippingFormula = useShippingFormula;
474         }
475     }
476 
477     public boolean getRequiresShipping() {
478         return _requiresShipping;
479     }
480 
481     public boolean isRequiresShipping() {
482         return _requiresShipping;
483     }
484 
485     public void setRequiresShipping(boolean requiresShipping) {
486         if (requiresShipping != _requiresShipping) {
487             _requiresShipping = requiresShipping;
488         }
489     }
490 
491     public int getStockQuantity() {
492         return _stockQuantity;
493     }
494 
495     public void setStockQuantity(int stockQuantity) {
496         if (stockQuantity != _stockQuantity) {
497             _stockQuantity = stockQuantity;
498         }
499     }
500 
501     public boolean getFeatured() {
502         return _featured;
503     }
504 
505     public boolean isFeatured() {
506         return _featured;
507     }
508 
509     public void setFeatured(boolean featured) {
510         if (featured != _featured) {
511             _featured = featured;
512         }
513     }
514 
515     public boolean getSale() {
516         return _sale;
517     }
518 
519     public boolean isSale() {
520         return _sale;
521     }
522 
523     public void setSale(boolean sale) {
524         if (sale != _sale) {
525             _sale = sale;
526         }
527     }
528 
529     public boolean getSmallImage() {
530         return _smallImage;
531     }
532 
533     public boolean isSmallImage() {
534         return _smallImage;
535     }
536 
537     public void setSmallImage(boolean smallImage) {
538         if (smallImage != _smallImage) {
539             _smallImage = smallImage;
540         }
541     }
542 
543     public long getSmallImageId() {
544         return _smallImageId;
545     }
546 
547     public void setSmallImageId(long smallImageId) {
548         if (smallImageId != _smallImageId) {
549             _smallImageId = smallImageId;
550         }
551     }
552 
553     public String getSmallImageURL() {
554         return GetterUtil.getString(_smallImageURL);
555     }
556 
557     public void setSmallImageURL(String smallImageURL) {
558         if (((smallImageURL == null) && (_smallImageURL != null)) ||
559                 ((smallImageURL != null) && (_smallImageURL == null)) ||
560                 ((smallImageURL != null) && (_smallImageURL != null) &&
561                 !smallImageURL.equals(_smallImageURL))) {
562             _smallImageURL = smallImageURL;
563         }
564     }
565 
566     public boolean getMediumImage() {
567         return _mediumImage;
568     }
569 
570     public boolean isMediumImage() {
571         return _mediumImage;
572     }
573 
574     public void setMediumImage(boolean mediumImage) {
575         if (mediumImage != _mediumImage) {
576             _mediumImage = mediumImage;
577         }
578     }
579 
580     public long getMediumImageId() {
581         return _mediumImageId;
582     }
583 
584     public void setMediumImageId(long mediumImageId) {
585         if (mediumImageId != _mediumImageId) {
586             _mediumImageId = mediumImageId;
587         }
588     }
589 
590     public String getMediumImageURL() {
591         return GetterUtil.getString(_mediumImageURL);
592     }
593 
594     public void setMediumImageURL(String mediumImageURL) {
595         if (((mediumImageURL == null) && (_mediumImageURL != null)) ||
596                 ((mediumImageURL != null) && (_mediumImageURL == null)) ||
597                 ((mediumImageURL != null) && (_mediumImageURL != null) &&
598                 !mediumImageURL.equals(_mediumImageURL))) {
599             _mediumImageURL = mediumImageURL;
600         }
601     }
602 
603     public boolean getLargeImage() {
604         return _largeImage;
605     }
606 
607     public boolean isLargeImage() {
608         return _largeImage;
609     }
610 
611     public void setLargeImage(boolean largeImage) {
612         if (largeImage != _largeImage) {
613             _largeImage = largeImage;
614         }
615     }
616 
617     public long getLargeImageId() {
618         return _largeImageId;
619     }
620 
621     public void setLargeImageId(long largeImageId) {
622         if (largeImageId != _largeImageId) {
623             _largeImageId = largeImageId;
624         }
625     }
626 
627     public String getLargeImageURL() {
628         return GetterUtil.getString(_largeImageURL);
629     }
630 
631     public void setLargeImageURL(String largeImageURL) {
632         if (((largeImageURL == null) && (_largeImageURL != null)) ||
633                 ((largeImageURL != null) && (_largeImageURL == null)) ||
634                 ((largeImageURL != null) && (_largeImageURL != null) &&
635                 !largeImageURL.equals(_largeImageURL))) {
636             _largeImageURL = largeImageURL;
637         }
638     }
639 
640     public ShoppingItem toEscapedModel() {
641         if (isEscapedModel()) {
642             return (ShoppingItem)this;
643         }
644         else {
645             ShoppingItem model = new ShoppingItemImpl();
646 
647             model.setNew(isNew());
648             model.setEscapedModel(true);
649 
650             model.setItemId(getItemId());
651             model.setCompanyId(getCompanyId());
652             model.setUserId(getUserId());
653             model.setUserName(HtmlUtil.escape(getUserName()));
654             model.setCreateDate(getCreateDate());
655             model.setModifiedDate(getModifiedDate());
656             model.setCategoryId(getCategoryId());
657             model.setSku(HtmlUtil.escape(getSku()));
658             model.setName(HtmlUtil.escape(getName()));
659             model.setDescription(HtmlUtil.escape(getDescription()));
660             model.setProperties(HtmlUtil.escape(getProperties()));
661             model.setFields(getFields());
662             model.setFieldsQuantities(HtmlUtil.escape(getFieldsQuantities()));
663             model.setMinQuantity(getMinQuantity());
664             model.setMaxQuantity(getMaxQuantity());
665             model.setPrice(getPrice());
666             model.setDiscount(getDiscount());
667             model.setTaxable(getTaxable());
668             model.setShipping(getShipping());
669             model.setUseShippingFormula(getUseShippingFormula());
670             model.setRequiresShipping(getRequiresShipping());
671             model.setStockQuantity(getStockQuantity());
672             model.setFeatured(getFeatured());
673             model.setSale(getSale());
674             model.setSmallImage(getSmallImage());
675             model.setSmallImageId(getSmallImageId());
676             model.setSmallImageURL(HtmlUtil.escape(getSmallImageURL()));
677             model.setMediumImage(getMediumImage());
678             model.setMediumImageId(getMediumImageId());
679             model.setMediumImageURL(HtmlUtil.escape(getMediumImageURL()));
680             model.setLargeImage(getLargeImage());
681             model.setLargeImageId(getLargeImageId());
682             model.setLargeImageURL(HtmlUtil.escape(getLargeImageURL()));
683 
684             model = (ShoppingItem)Proxy.newProxyInstance(ShoppingItem.class.getClassLoader(),
685                     new Class[] { ShoppingItem.class },
686                     new ReadOnlyBeanHandler(model));
687 
688             return model;
689         }
690     }
691 
692     public ExpandoBridge getExpandoBridge() {
693         if (_expandoBridge == null) {
694             _expandoBridge = new ExpandoBridgeImpl(ShoppingItem.class.getName(),
695                     getPrimaryKey());
696         }
697 
698         return _expandoBridge;
699     }
700 
701     public Object clone() {
702         ShoppingItemImpl clone = new ShoppingItemImpl();
703 
704         clone.setItemId(getItemId());
705         clone.setCompanyId(getCompanyId());
706         clone.setUserId(getUserId());
707         clone.setUserName(getUserName());
708         clone.setCreateDate(getCreateDate());
709         clone.setModifiedDate(getModifiedDate());
710         clone.setCategoryId(getCategoryId());
711         clone.setSku(getSku());
712         clone.setName(getName());
713         clone.setDescription(getDescription());
714         clone.setProperties(getProperties());
715         clone.setFields(getFields());
716         clone.setFieldsQuantities(getFieldsQuantities());
717         clone.setMinQuantity(getMinQuantity());
718         clone.setMaxQuantity(getMaxQuantity());
719         clone.setPrice(getPrice());
720         clone.setDiscount(getDiscount());
721         clone.setTaxable(getTaxable());
722         clone.setShipping(getShipping());
723         clone.setUseShippingFormula(getUseShippingFormula());
724         clone.setRequiresShipping(getRequiresShipping());
725         clone.setStockQuantity(getStockQuantity());
726         clone.setFeatured(getFeatured());
727         clone.setSale(getSale());
728         clone.setSmallImage(getSmallImage());
729         clone.setSmallImageId(getSmallImageId());
730         clone.setSmallImageURL(getSmallImageURL());
731         clone.setMediumImage(getMediumImage());
732         clone.setMediumImageId(getMediumImageId());
733         clone.setMediumImageURL(getMediumImageURL());
734         clone.setLargeImage(getLargeImage());
735         clone.setLargeImageId(getLargeImageId());
736         clone.setLargeImageURL(getLargeImageURL());
737 
738         return clone;
739     }
740 
741     public int compareTo(Object obj) {
742         if (obj == null) {
743             return -1;
744         }
745 
746         ShoppingItemImpl shoppingItem = (ShoppingItemImpl)obj;
747 
748         int value = 0;
749 
750         if (getItemId() < shoppingItem.getItemId()) {
751             value = -1;
752         }
753         else if (getItemId() > shoppingItem.getItemId()) {
754             value = 1;
755         }
756         else {
757             value = 0;
758         }
759 
760         if (value != 0) {
761             return value;
762         }
763 
764         return 0;
765     }
766 
767     public boolean equals(Object obj) {
768         if (obj == null) {
769             return false;
770         }
771 
772         ShoppingItemImpl shoppingItem = null;
773 
774         try {
775             shoppingItem = (ShoppingItemImpl)obj;
776         }
777         catch (ClassCastException cce) {
778             return false;
779         }
780 
781         long pk = shoppingItem.getPrimaryKey();
782 
783         if (getPrimaryKey() == pk) {
784             return true;
785         }
786         else {
787             return false;
788         }
789     }
790 
791     public int hashCode() {
792         return (int)getPrimaryKey();
793     }
794 
795     private long _itemId;
796     private long _companyId;
797     private long _userId;
798     private String _userName;
799     private Date _createDate;
800     private Date _modifiedDate;
801     private long _categoryId;
802     private String _sku;
803     private String _name;
804     private String _description;
805     private String _properties;
806     private boolean _fields;
807     private String _fieldsQuantities;
808     private int _minQuantity;
809     private int _maxQuantity;
810     private double _price;
811     private double _discount;
812     private boolean _taxable;
813     private double _shipping;
814     private boolean _useShippingFormula;
815     private boolean _requiresShipping;
816     private int _stockQuantity;
817     private boolean _featured;
818     private boolean _sale;
819     private boolean _smallImage;
820     private long _smallImageId;
821     private String _smallImageURL;
822     private boolean _mediumImage;
823     private long _mediumImageId;
824     private String _mediumImageURL;
825     private boolean _largeImage;
826     private long _largeImageId;
827     private String _largeImageURL;
828     private transient ExpandoBridge _expandoBridge;
829 }