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