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.service.persistence;
24  
25  import com.liferay.portal.SystemException;
26  import com.liferay.portal.kernel.bean.InitializingBean;
27  import com.liferay.portal.kernel.dao.orm.DynamicQuery;
28  import com.liferay.portal.kernel.dao.orm.FinderCacheUtil;
29  import com.liferay.portal.kernel.dao.orm.Query;
30  import com.liferay.portal.kernel.dao.orm.QueryPos;
31  import com.liferay.portal.kernel.dao.orm.QueryUtil;
32  import com.liferay.portal.kernel.dao.orm.Session;
33  import com.liferay.portal.kernel.util.GetterUtil;
34  import com.liferay.portal.kernel.util.ListUtil;
35  import com.liferay.portal.kernel.util.OrderByComparator;
36  import com.liferay.portal.kernel.util.StringPool;
37  import com.liferay.portal.kernel.util.StringUtil;
38  import com.liferay.portal.model.ModelListener;
39  import com.liferay.portal.service.persistence.impl.BasePersistenceImpl;
40  
41  import com.liferay.portlet.shopping.NoSuchItemFieldException;
42  import com.liferay.portlet.shopping.model.ShoppingItemField;
43  import com.liferay.portlet.shopping.model.impl.ShoppingItemFieldImpl;
44  import com.liferay.portlet.shopping.model.impl.ShoppingItemFieldModelImpl;
45  
46  import org.apache.commons.logging.Log;
47  import org.apache.commons.logging.LogFactory;
48  
49  import java.util.ArrayList;
50  import java.util.Collections;
51  import java.util.Iterator;
52  import java.util.List;
53  
54  /**
55   * <a href="ShoppingItemFieldPersistenceImpl.java.html"><b><i>View Source</i></b></a>
56   *
57   * @author Brian Wing Shun Chan
58   *
59   */
60  public class ShoppingItemFieldPersistenceImpl extends BasePersistenceImpl
61      implements ShoppingItemFieldPersistence, InitializingBean {
62      public ShoppingItemField create(long itemFieldId) {
63          ShoppingItemField shoppingItemField = new ShoppingItemFieldImpl();
64  
65          shoppingItemField.setNew(true);
66          shoppingItemField.setPrimaryKey(itemFieldId);
67  
68          return shoppingItemField;
69      }
70  
71      public ShoppingItemField remove(long itemFieldId)
72          throws NoSuchItemFieldException, SystemException {
73          Session session = null;
74  
75          try {
76              session = openSession();
77  
78              ShoppingItemField shoppingItemField = (ShoppingItemField)session.get(ShoppingItemFieldImpl.class,
79                      new Long(itemFieldId));
80  
81              if (shoppingItemField == null) {
82                  if (_log.isWarnEnabled()) {
83                      _log.warn(
84                          "No ShoppingItemField exists with the primary key " +
85                          itemFieldId);
86                  }
87  
88                  throw new NoSuchItemFieldException(
89                      "No ShoppingItemField exists with the primary key " +
90                      itemFieldId);
91              }
92  
93              return remove(shoppingItemField);
94          }
95          catch (NoSuchItemFieldException nsee) {
96              throw nsee;
97          }
98          catch (Exception e) {
99              throw processException(e);
100         }
101         finally {
102             closeSession(session);
103         }
104     }
105 
106     public ShoppingItemField remove(ShoppingItemField shoppingItemField)
107         throws SystemException {
108         if (_listeners.length > 0) {
109             for (ModelListener listener : _listeners) {
110                 listener.onBeforeRemove(shoppingItemField);
111             }
112         }
113 
114         shoppingItemField = removeImpl(shoppingItemField);
115 
116         if (_listeners.length > 0) {
117             for (ModelListener listener : _listeners) {
118                 listener.onAfterRemove(shoppingItemField);
119             }
120         }
121 
122         return shoppingItemField;
123     }
124 
125     protected ShoppingItemField removeImpl(ShoppingItemField shoppingItemField)
126         throws SystemException {
127         Session session = null;
128 
129         try {
130             session = openSession();
131 
132             session.delete(shoppingItemField);
133 
134             session.flush();
135 
136             return shoppingItemField;
137         }
138         catch (Exception e) {
139             throw processException(e);
140         }
141         finally {
142             closeSession(session);
143 
144             FinderCacheUtil.clearCache(ShoppingItemField.class.getName());
145         }
146     }
147 
148     /**
149      * @deprecated Use <code>update(ShoppingItemField shoppingItemField, boolean merge)</code>.
150      */
151     public ShoppingItemField update(ShoppingItemField shoppingItemField)
152         throws SystemException {
153         if (_log.isWarnEnabled()) {
154             _log.warn(
155                 "Using the deprecated update(ShoppingItemField shoppingItemField) method. Use update(ShoppingItemField shoppingItemField, boolean merge) instead.");
156         }
157 
158         return update(shoppingItemField, false);
159     }
160 
161     /**
162      * Add, update, or merge, the entity. This method also calls the model
163      * listeners to trigger the proper events associated with adding, deleting,
164      * or updating an entity.
165      *
166      * @param        shoppingItemField the entity to add, update, or merge
167      * @param        merge boolean value for whether to merge the entity. The
168      *                default value is false. Setting merge to true is more
169      *                expensive and should only be true when shoppingItemField is
170      *                transient. See LEP-5473 for a detailed discussion of this
171      *                method.
172      * @return        true if the portlet can be displayed via Ajax
173      */
174     public ShoppingItemField update(ShoppingItemField shoppingItemField,
175         boolean merge) throws SystemException {
176         boolean isNew = shoppingItemField.isNew();
177 
178         if (_listeners.length > 0) {
179             for (ModelListener listener : _listeners) {
180                 if (isNew) {
181                     listener.onBeforeCreate(shoppingItemField);
182                 }
183                 else {
184                     listener.onBeforeUpdate(shoppingItemField);
185                 }
186             }
187         }
188 
189         shoppingItemField = updateImpl(shoppingItemField, merge);
190 
191         if (_listeners.length > 0) {
192             for (ModelListener listener : _listeners) {
193                 if (isNew) {
194                     listener.onAfterCreate(shoppingItemField);
195                 }
196                 else {
197                     listener.onAfterUpdate(shoppingItemField);
198                 }
199             }
200         }
201 
202         return shoppingItemField;
203     }
204 
205     public ShoppingItemField updateImpl(
206         com.liferay.portlet.shopping.model.ShoppingItemField shoppingItemField,
207         boolean merge) throws SystemException {
208         Session session = null;
209 
210         try {
211             session = openSession();
212 
213             if (merge) {
214                 session.merge(shoppingItemField);
215             }
216             else {
217                 if (shoppingItemField.isNew()) {
218                     session.save(shoppingItemField);
219                 }
220             }
221 
222             session.flush();
223 
224             shoppingItemField.setNew(false);
225 
226             return shoppingItemField;
227         }
228         catch (Exception e) {
229             throw processException(e);
230         }
231         finally {
232             closeSession(session);
233 
234             FinderCacheUtil.clearCache(ShoppingItemField.class.getName());
235         }
236     }
237 
238     public ShoppingItemField findByPrimaryKey(long itemFieldId)
239         throws NoSuchItemFieldException, SystemException {
240         ShoppingItemField shoppingItemField = fetchByPrimaryKey(itemFieldId);
241 
242         if (shoppingItemField == null) {
243             if (_log.isWarnEnabled()) {
244                 _log.warn("No ShoppingItemField exists with the primary key " +
245                     itemFieldId);
246             }
247 
248             throw new NoSuchItemFieldException(
249                 "No ShoppingItemField exists with the primary key " +
250                 itemFieldId);
251         }
252 
253         return shoppingItemField;
254     }
255 
256     public ShoppingItemField fetchByPrimaryKey(long itemFieldId)
257         throws SystemException {
258         Session session = null;
259 
260         try {
261             session = openSession();
262 
263             return (ShoppingItemField)session.get(ShoppingItemFieldImpl.class,
264                 new Long(itemFieldId));
265         }
266         catch (Exception e) {
267             throw processException(e);
268         }
269         finally {
270             closeSession(session);
271         }
272     }
273 
274     public List<ShoppingItemField> findByItemId(long itemId)
275         throws SystemException {
276         boolean finderClassNameCacheEnabled = ShoppingItemFieldModelImpl.CACHE_ENABLED;
277         String finderClassName = ShoppingItemField.class.getName();
278         String finderMethodName = "findByItemId";
279         String[] finderParams = new String[] { Long.class.getName() };
280         Object[] finderArgs = new Object[] { new Long(itemId) };
281 
282         Object result = null;
283 
284         if (finderClassNameCacheEnabled) {
285             result = FinderCacheUtil.getResult(finderClassName,
286                     finderMethodName, finderParams, finderArgs, this);
287         }
288 
289         if (result == null) {
290             Session session = null;
291 
292             try {
293                 session = openSession();
294 
295                 StringBuilder query = new StringBuilder();
296 
297                 query.append(
298                     "FROM com.liferay.portlet.shopping.model.ShoppingItemField WHERE ");
299 
300                 query.append("itemId = ?");
301 
302                 query.append(" ");
303 
304                 query.append("ORDER BY ");
305 
306                 query.append("itemId ASC, ");
307                 query.append("name ASC");
308 
309                 Query q = session.createQuery(query.toString());
310 
311                 QueryPos qPos = QueryPos.getInstance(q);
312 
313                 qPos.add(itemId);
314 
315                 List<ShoppingItemField> list = q.list();
316 
317                 FinderCacheUtil.putResult(finderClassNameCacheEnabled,
318                     finderClassName, finderMethodName, finderParams,
319                     finderArgs, list);
320 
321                 return list;
322             }
323             catch (Exception e) {
324                 throw processException(e);
325             }
326             finally {
327                 closeSession(session);
328             }
329         }
330         else {
331             return (List<ShoppingItemField>)result;
332         }
333     }
334 
335     public List<ShoppingItemField> findByItemId(long itemId, int start, int end)
336         throws SystemException {
337         return findByItemId(itemId, start, end, null);
338     }
339 
340     public List<ShoppingItemField> findByItemId(long itemId, int start,
341         int end, OrderByComparator obc) throws SystemException {
342         boolean finderClassNameCacheEnabled = ShoppingItemFieldModelImpl.CACHE_ENABLED;
343         String finderClassName = ShoppingItemField.class.getName();
344         String finderMethodName = "findByItemId";
345         String[] finderParams = new String[] {
346                 Long.class.getName(),
347                 
348                 "java.lang.Integer", "java.lang.Integer",
349                 "com.liferay.portal.kernel.util.OrderByComparator"
350             };
351         Object[] finderArgs = new Object[] {
352                 new Long(itemId),
353                 
354                 String.valueOf(start), String.valueOf(end), String.valueOf(obc)
355             };
356 
357         Object result = null;
358 
359         if (finderClassNameCacheEnabled) {
360             result = FinderCacheUtil.getResult(finderClassName,
361                     finderMethodName, finderParams, finderArgs, this);
362         }
363 
364         if (result == null) {
365             Session session = null;
366 
367             try {
368                 session = openSession();
369 
370                 StringBuilder query = new StringBuilder();
371 
372                 query.append(
373                     "FROM com.liferay.portlet.shopping.model.ShoppingItemField WHERE ");
374 
375                 query.append("itemId = ?");
376 
377                 query.append(" ");
378 
379                 if (obc != null) {
380                     query.append("ORDER BY ");
381                     query.append(obc.getOrderBy());
382                 }
383 
384                 else {
385                     query.append("ORDER BY ");
386 
387                     query.append("itemId ASC, ");
388                     query.append("name ASC");
389                 }
390 
391                 Query q = session.createQuery(query.toString());
392 
393                 QueryPos qPos = QueryPos.getInstance(q);
394 
395                 qPos.add(itemId);
396 
397                 List<ShoppingItemField> list = (List<ShoppingItemField>)QueryUtil.list(q,
398                         getDialect(), start, end);
399 
400                 FinderCacheUtil.putResult(finderClassNameCacheEnabled,
401                     finderClassName, finderMethodName, finderParams,
402                     finderArgs, list);
403 
404                 return list;
405             }
406             catch (Exception e) {
407                 throw processException(e);
408             }
409             finally {
410                 closeSession(session);
411             }
412         }
413         else {
414             return (List<ShoppingItemField>)result;
415         }
416     }
417 
418     public ShoppingItemField findByItemId_First(long itemId,
419         OrderByComparator obc) throws NoSuchItemFieldException, SystemException {
420         List<ShoppingItemField> list = findByItemId(itemId, 0, 1, obc);
421 
422         if (list.size() == 0) {
423             StringBuilder msg = new StringBuilder();
424 
425             msg.append("No ShoppingItemField exists with the key {");
426 
427             msg.append("itemId=" + itemId);
428 
429             msg.append(StringPool.CLOSE_CURLY_BRACE);
430 
431             throw new NoSuchItemFieldException(msg.toString());
432         }
433         else {
434             return list.get(0);
435         }
436     }
437 
438     public ShoppingItemField findByItemId_Last(long itemId,
439         OrderByComparator obc) throws NoSuchItemFieldException, SystemException {
440         int count = countByItemId(itemId);
441 
442         List<ShoppingItemField> list = findByItemId(itemId, count - 1, count,
443                 obc);
444 
445         if (list.size() == 0) {
446             StringBuilder msg = new StringBuilder();
447 
448             msg.append("No ShoppingItemField exists with the key {");
449 
450             msg.append("itemId=" + itemId);
451 
452             msg.append(StringPool.CLOSE_CURLY_BRACE);
453 
454             throw new NoSuchItemFieldException(msg.toString());
455         }
456         else {
457             return list.get(0);
458         }
459     }
460 
461     public ShoppingItemField[] findByItemId_PrevAndNext(long itemFieldId,
462         long itemId, OrderByComparator obc)
463         throws NoSuchItemFieldException, SystemException {
464         ShoppingItemField shoppingItemField = findByPrimaryKey(itemFieldId);
465 
466         int count = countByItemId(itemId);
467 
468         Session session = null;
469 
470         try {
471             session = openSession();
472 
473             StringBuilder query = new StringBuilder();
474 
475             query.append(
476                 "FROM com.liferay.portlet.shopping.model.ShoppingItemField WHERE ");
477 
478             query.append("itemId = ?");
479 
480             query.append(" ");
481 
482             if (obc != null) {
483                 query.append("ORDER BY ");
484                 query.append(obc.getOrderBy());
485             }
486 
487             else {
488                 query.append("ORDER BY ");
489 
490                 query.append("itemId ASC, ");
491                 query.append("name ASC");
492             }
493 
494             Query q = session.createQuery(query.toString());
495 
496             QueryPos qPos = QueryPos.getInstance(q);
497 
498             qPos.add(itemId);
499 
500             Object[] objArray = QueryUtil.getPrevAndNext(q, count, obc,
501                     shoppingItemField);
502 
503             ShoppingItemField[] array = new ShoppingItemFieldImpl[3];
504 
505             array[0] = (ShoppingItemField)objArray[0];
506             array[1] = (ShoppingItemField)objArray[1];
507             array[2] = (ShoppingItemField)objArray[2];
508 
509             return array;
510         }
511         catch (Exception e) {
512             throw processException(e);
513         }
514         finally {
515             closeSession(session);
516         }
517     }
518 
519     public List<Object> findWithDynamicQuery(DynamicQuery dynamicQuery)
520         throws SystemException {
521         Session session = null;
522 
523         try {
524             session = openSession();
525 
526             dynamicQuery.compile(session);
527 
528             return dynamicQuery.list();
529         }
530         catch (Exception e) {
531             throw processException(e);
532         }
533         finally {
534             closeSession(session);
535         }
536     }
537 
538     public List<Object> findWithDynamicQuery(DynamicQuery dynamicQuery,
539         int start, int end) throws SystemException {
540         Session session = null;
541 
542         try {
543             session = openSession();
544 
545             dynamicQuery.setLimit(start, end);
546 
547             dynamicQuery.compile(session);
548 
549             return dynamicQuery.list();
550         }
551         catch (Exception e) {
552             throw processException(e);
553         }
554         finally {
555             closeSession(session);
556         }
557     }
558 
559     public List<ShoppingItemField> findAll() throws SystemException {
560         return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
561     }
562 
563     public List<ShoppingItemField> findAll(int start, int end)
564         throws SystemException {
565         return findAll(start, end, null);
566     }
567 
568     public List<ShoppingItemField> findAll(int start, int end,
569         OrderByComparator obc) throws SystemException {
570         boolean finderClassNameCacheEnabled = ShoppingItemFieldModelImpl.CACHE_ENABLED;
571         String finderClassName = ShoppingItemField.class.getName();
572         String finderMethodName = "findAll";
573         String[] finderParams = new String[] {
574                 "java.lang.Integer", "java.lang.Integer",
575                 "com.liferay.portal.kernel.util.OrderByComparator"
576             };
577         Object[] finderArgs = new Object[] {
578                 String.valueOf(start), String.valueOf(end), String.valueOf(obc)
579             };
580 
581         Object result = null;
582 
583         if (finderClassNameCacheEnabled) {
584             result = FinderCacheUtil.getResult(finderClassName,
585                     finderMethodName, finderParams, finderArgs, this);
586         }
587 
588         if (result == null) {
589             Session session = null;
590 
591             try {
592                 session = openSession();
593 
594                 StringBuilder query = new StringBuilder();
595 
596                 query.append(
597                     "FROM com.liferay.portlet.shopping.model.ShoppingItemField ");
598 
599                 if (obc != null) {
600                     query.append("ORDER BY ");
601                     query.append(obc.getOrderBy());
602                 }
603 
604                 else {
605                     query.append("ORDER BY ");
606 
607                     query.append("itemId ASC, ");
608                     query.append("name ASC");
609                 }
610 
611                 Query q = session.createQuery(query.toString());
612 
613                 List<ShoppingItemField> list = (List<ShoppingItemField>)QueryUtil.list(q,
614                         getDialect(), start, end);
615 
616                 if (obc == null) {
617                     Collections.sort(list);
618                 }
619 
620                 FinderCacheUtil.putResult(finderClassNameCacheEnabled,
621                     finderClassName, finderMethodName, finderParams,
622                     finderArgs, list);
623 
624                 return list;
625             }
626             catch (Exception e) {
627                 throw processException(e);
628             }
629             finally {
630                 closeSession(session);
631             }
632         }
633         else {
634             return (List<ShoppingItemField>)result;
635         }
636     }
637 
638     public void removeByItemId(long itemId) throws SystemException {
639         for (ShoppingItemField shoppingItemField : findByItemId(itemId)) {
640             remove(shoppingItemField);
641         }
642     }
643 
644     public void removeAll() throws SystemException {
645         for (ShoppingItemField shoppingItemField : findAll()) {
646             remove(shoppingItemField);
647         }
648     }
649 
650     public int countByItemId(long itemId) throws SystemException {
651         boolean finderClassNameCacheEnabled = ShoppingItemFieldModelImpl.CACHE_ENABLED;
652         String finderClassName = ShoppingItemField.class.getName();
653         String finderMethodName = "countByItemId";
654         String[] finderParams = new String[] { Long.class.getName() };
655         Object[] finderArgs = new Object[] { new Long(itemId) };
656 
657         Object result = null;
658 
659         if (finderClassNameCacheEnabled) {
660             result = FinderCacheUtil.getResult(finderClassName,
661                     finderMethodName, finderParams, finderArgs, this);
662         }
663 
664         if (result == null) {
665             Session session = null;
666 
667             try {
668                 session = openSession();
669 
670                 StringBuilder query = new StringBuilder();
671 
672                 query.append("SELECT COUNT(*) ");
673                 query.append(
674                     "FROM com.liferay.portlet.shopping.model.ShoppingItemField WHERE ");
675 
676                 query.append("itemId = ?");
677 
678                 query.append(" ");
679 
680                 Query q = session.createQuery(query.toString());
681 
682                 QueryPos qPos = QueryPos.getInstance(q);
683 
684                 qPos.add(itemId);
685 
686                 Long count = null;
687 
688                 Iterator<Long> itr = q.list().iterator();
689 
690                 if (itr.hasNext()) {
691                     count = itr.next();
692                 }
693 
694                 if (count == null) {
695                     count = new Long(0);
696                 }
697 
698                 FinderCacheUtil.putResult(finderClassNameCacheEnabled,
699                     finderClassName, finderMethodName, finderParams,
700                     finderArgs, count);
701 
702                 return count.intValue();
703             }
704             catch (Exception e) {
705                 throw processException(e);
706             }
707             finally {
708                 closeSession(session);
709             }
710         }
711         else {
712             return ((Long)result).intValue();
713         }
714     }
715 
716     public int countAll() throws SystemException {
717         boolean finderClassNameCacheEnabled = ShoppingItemFieldModelImpl.CACHE_ENABLED;
718         String finderClassName = ShoppingItemField.class.getName();
719         String finderMethodName = "countAll";
720         String[] finderParams = new String[] {  };
721         Object[] finderArgs = new Object[] {  };
722 
723         Object result = null;
724 
725         if (finderClassNameCacheEnabled) {
726             result = FinderCacheUtil.getResult(finderClassName,
727                     finderMethodName, finderParams, finderArgs, this);
728         }
729 
730         if (result == null) {
731             Session session = null;
732 
733             try {
734                 session = openSession();
735 
736                 Query q = session.createQuery(
737                         "SELECT COUNT(*) FROM com.liferay.portlet.shopping.model.ShoppingItemField");
738 
739                 Long count = null;
740 
741                 Iterator<Long> itr = q.list().iterator();
742 
743                 if (itr.hasNext()) {
744                     count = itr.next();
745                 }
746 
747                 if (count == null) {
748                     count = new Long(0);
749                 }
750 
751                 FinderCacheUtil.putResult(finderClassNameCacheEnabled,
752                     finderClassName, finderMethodName, finderParams,
753                     finderArgs, count);
754 
755                 return count.intValue();
756             }
757             catch (Exception e) {
758                 throw processException(e);
759             }
760             finally {
761                 closeSession(session);
762             }
763         }
764         else {
765             return ((Long)result).intValue();
766         }
767     }
768 
769     public void registerListener(ModelListener listener) {
770         List<ModelListener> listeners = ListUtil.fromArray(_listeners);
771 
772         listeners.add(listener);
773 
774         _listeners = listeners.toArray(new ModelListener[listeners.size()]);
775     }
776 
777     public void unregisterListener(ModelListener listener) {
778         List<ModelListener> listeners = ListUtil.fromArray(_listeners);
779 
780         listeners.remove(listener);
781 
782         _listeners = listeners.toArray(new ModelListener[listeners.size()]);
783     }
784 
785     public void afterPropertiesSet() {
786         String[] listenerClassNames = StringUtil.split(GetterUtil.getString(
787                     com.liferay.portal.util.PropsUtil.get(
788                         "value.object.listener.com.liferay.portlet.shopping.model.ShoppingItemField")));
789 
790         if (listenerClassNames.length > 0) {
791             try {
792                 List<ModelListener> listeners = new ArrayList<ModelListener>();
793 
794                 for (String listenerClassName : listenerClassNames) {
795                     listeners.add((ModelListener)Class.forName(
796                             listenerClassName).newInstance());
797                 }
798 
799                 _listeners = listeners.toArray(new ModelListener[listeners.size()]);
800             }
801             catch (Exception e) {
802                 _log.error(e);
803             }
804         }
805     }
806 
807     private static Log _log = LogFactory.getLog(ShoppingItemFieldPersistenceImpl.class);
808     private ModelListener[] _listeners = new ModelListener[0];
809 }