001
014
015 package com.liferay.portlet.shopping.service.persistence;
016
017 import com.liferay.portal.NoSuchModelException;
018 import com.liferay.portal.kernel.annotation.BeanReference;
019 import com.liferay.portal.kernel.cache.CacheRegistryUtil;
020 import com.liferay.portal.kernel.dao.orm.EntityCacheUtil;
021 import com.liferay.portal.kernel.dao.orm.FinderCacheUtil;
022 import com.liferay.portal.kernel.dao.orm.FinderPath;
023 import com.liferay.portal.kernel.dao.orm.Query;
024 import com.liferay.portal.kernel.dao.orm.QueryPos;
025 import com.liferay.portal.kernel.dao.orm.QueryUtil;
026 import com.liferay.portal.kernel.dao.orm.Session;
027 import com.liferay.portal.kernel.exception.SystemException;
028 import com.liferay.portal.kernel.log.Log;
029 import com.liferay.portal.kernel.log.LogFactoryUtil;
030 import com.liferay.portal.kernel.util.GetterUtil;
031 import com.liferay.portal.kernel.util.InstanceFactory;
032 import com.liferay.portal.kernel.util.OrderByComparator;
033 import com.liferay.portal.kernel.util.StringBundler;
034 import com.liferay.portal.kernel.util.StringPool;
035 import com.liferay.portal.kernel.util.StringUtil;
036 import com.liferay.portal.model.ModelListener;
037 import com.liferay.portal.service.persistence.BatchSessionUtil;
038 import com.liferay.portal.service.persistence.ResourcePersistence;
039 import com.liferay.portal.service.persistence.UserPersistence;
040 import com.liferay.portal.service.persistence.impl.BasePersistenceImpl;
041
042 import com.liferay.portlet.shopping.NoSuchItemFieldException;
043 import com.liferay.portlet.shopping.model.ShoppingItemField;
044 import com.liferay.portlet.shopping.model.impl.ShoppingItemFieldImpl;
045 import com.liferay.portlet.shopping.model.impl.ShoppingItemFieldModelImpl;
046
047 import java.io.Serializable;
048
049 import java.util.ArrayList;
050 import java.util.Collections;
051 import java.util.List;
052
053
069 public class ShoppingItemFieldPersistenceImpl extends BasePersistenceImpl<ShoppingItemField>
070 implements ShoppingItemFieldPersistence {
071 public static final String FINDER_CLASS_NAME_ENTITY = ShoppingItemFieldImpl.class.getName();
072 public static final String FINDER_CLASS_NAME_LIST = FINDER_CLASS_NAME_ENTITY +
073 ".List";
074 public static final FinderPath FINDER_PATH_FIND_BY_ITEMID = new FinderPath(ShoppingItemFieldModelImpl.ENTITY_CACHE_ENABLED,
075 ShoppingItemFieldModelImpl.FINDER_CACHE_ENABLED,
076 FINDER_CLASS_NAME_LIST, "findByItemId",
077 new String[] {
078 Long.class.getName(),
079
080 "java.lang.Integer", "java.lang.Integer",
081 "com.liferay.portal.kernel.util.OrderByComparator"
082 });
083 public static final FinderPath FINDER_PATH_COUNT_BY_ITEMID = new FinderPath(ShoppingItemFieldModelImpl.ENTITY_CACHE_ENABLED,
084 ShoppingItemFieldModelImpl.FINDER_CACHE_ENABLED,
085 FINDER_CLASS_NAME_LIST, "countByItemId",
086 new String[] { Long.class.getName() });
087 public static final FinderPath FINDER_PATH_FIND_ALL = new FinderPath(ShoppingItemFieldModelImpl.ENTITY_CACHE_ENABLED,
088 ShoppingItemFieldModelImpl.FINDER_CACHE_ENABLED,
089 FINDER_CLASS_NAME_LIST, "findAll", new String[0]);
090 public static final FinderPath FINDER_PATH_COUNT_ALL = new FinderPath(ShoppingItemFieldModelImpl.ENTITY_CACHE_ENABLED,
091 ShoppingItemFieldModelImpl.FINDER_CACHE_ENABLED,
092 FINDER_CLASS_NAME_LIST, "countAll", new String[0]);
093
094
099 public void cacheResult(ShoppingItemField shoppingItemField) {
100 EntityCacheUtil.putResult(ShoppingItemFieldModelImpl.ENTITY_CACHE_ENABLED,
101 ShoppingItemFieldImpl.class, shoppingItemField.getPrimaryKey(),
102 shoppingItemField);
103 }
104
105
110 public void cacheResult(List<ShoppingItemField> shoppingItemFields) {
111 for (ShoppingItemField shoppingItemField : shoppingItemFields) {
112 if (EntityCacheUtil.getResult(
113 ShoppingItemFieldModelImpl.ENTITY_CACHE_ENABLED,
114 ShoppingItemFieldImpl.class,
115 shoppingItemField.getPrimaryKey(), this) == null) {
116 cacheResult(shoppingItemField);
117 }
118 }
119 }
120
121
128 public void clearCache() {
129 CacheRegistryUtil.clear(ShoppingItemFieldImpl.class.getName());
130 EntityCacheUtil.clearCache(ShoppingItemFieldImpl.class.getName());
131 FinderCacheUtil.clearCache(FINDER_CLASS_NAME_ENTITY);
132 FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST);
133 }
134
135
142 public void clearCache(ShoppingItemField shoppingItemField) {
143 EntityCacheUtil.removeResult(ShoppingItemFieldModelImpl.ENTITY_CACHE_ENABLED,
144 ShoppingItemFieldImpl.class, shoppingItemField.getPrimaryKey());
145 }
146
147
153 public ShoppingItemField create(long itemFieldId) {
154 ShoppingItemField shoppingItemField = new ShoppingItemFieldImpl();
155
156 shoppingItemField.setNew(true);
157 shoppingItemField.setPrimaryKey(itemFieldId);
158
159 return shoppingItemField;
160 }
161
162
170 public ShoppingItemField remove(Serializable primaryKey)
171 throws NoSuchModelException, SystemException {
172 return remove(((Long)primaryKey).longValue());
173 }
174
175
183 public ShoppingItemField remove(long itemFieldId)
184 throws NoSuchItemFieldException, SystemException {
185 Session session = null;
186
187 try {
188 session = openSession();
189
190 ShoppingItemField shoppingItemField = (ShoppingItemField)session.get(ShoppingItemFieldImpl.class,
191 new Long(itemFieldId));
192
193 if (shoppingItemField == null) {
194 if (_log.isWarnEnabled()) {
195 _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + itemFieldId);
196 }
197
198 throw new NoSuchItemFieldException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
199 itemFieldId);
200 }
201
202 return remove(shoppingItemField);
203 }
204 catch (NoSuchItemFieldException nsee) {
205 throw nsee;
206 }
207 catch (Exception e) {
208 throw processException(e);
209 }
210 finally {
211 closeSession(session);
212 }
213 }
214
215 protected ShoppingItemField removeImpl(ShoppingItemField shoppingItemField)
216 throws SystemException {
217 shoppingItemField = toUnwrappedModel(shoppingItemField);
218
219 Session session = null;
220
221 try {
222 session = openSession();
223
224 if (shoppingItemField.isCachedModel() ||
225 BatchSessionUtil.isEnabled()) {
226 Object staleObject = session.get(ShoppingItemFieldImpl.class,
227 shoppingItemField.getPrimaryKeyObj());
228
229 if (staleObject != null) {
230 session.evict(staleObject);
231 }
232 }
233
234 session.delete(shoppingItemField);
235
236 session.flush();
237 }
238 catch (Exception e) {
239 throw processException(e);
240 }
241 finally {
242 closeSession(session);
243 }
244
245 FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST);
246
247 EntityCacheUtil.removeResult(ShoppingItemFieldModelImpl.ENTITY_CACHE_ENABLED,
248 ShoppingItemFieldImpl.class, shoppingItemField.getPrimaryKey());
249
250 return shoppingItemField;
251 }
252
253 public ShoppingItemField updateImpl(
254 com.liferay.portlet.shopping.model.ShoppingItemField shoppingItemField,
255 boolean merge) throws SystemException {
256 shoppingItemField = toUnwrappedModel(shoppingItemField);
257
258 Session session = null;
259
260 try {
261 session = openSession();
262
263 BatchSessionUtil.update(session, shoppingItemField, merge);
264
265 shoppingItemField.setNew(false);
266 }
267 catch (Exception e) {
268 throw processException(e);
269 }
270 finally {
271 closeSession(session);
272 }
273
274 FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST);
275
276 EntityCacheUtil.putResult(ShoppingItemFieldModelImpl.ENTITY_CACHE_ENABLED,
277 ShoppingItemFieldImpl.class, shoppingItemField.getPrimaryKey(),
278 shoppingItemField);
279
280 return shoppingItemField;
281 }
282
283 protected ShoppingItemField toUnwrappedModel(
284 ShoppingItemField shoppingItemField) {
285 if (shoppingItemField instanceof ShoppingItemFieldImpl) {
286 return shoppingItemField;
287 }
288
289 ShoppingItemFieldImpl shoppingItemFieldImpl = new ShoppingItemFieldImpl();
290
291 shoppingItemFieldImpl.setNew(shoppingItemField.isNew());
292 shoppingItemFieldImpl.setPrimaryKey(shoppingItemField.getPrimaryKey());
293
294 shoppingItemFieldImpl.setItemFieldId(shoppingItemField.getItemFieldId());
295 shoppingItemFieldImpl.setItemId(shoppingItemField.getItemId());
296 shoppingItemFieldImpl.setName(shoppingItemField.getName());
297 shoppingItemFieldImpl.setValues(shoppingItemField.getValues());
298 shoppingItemFieldImpl.setDescription(shoppingItemField.getDescription());
299
300 return shoppingItemFieldImpl;
301 }
302
303
311 public ShoppingItemField findByPrimaryKey(Serializable primaryKey)
312 throws NoSuchModelException, SystemException {
313 return findByPrimaryKey(((Long)primaryKey).longValue());
314 }
315
316
324 public ShoppingItemField findByPrimaryKey(long itemFieldId)
325 throws NoSuchItemFieldException, SystemException {
326 ShoppingItemField shoppingItemField = fetchByPrimaryKey(itemFieldId);
327
328 if (shoppingItemField == null) {
329 if (_log.isWarnEnabled()) {
330 _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + itemFieldId);
331 }
332
333 throw new NoSuchItemFieldException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
334 itemFieldId);
335 }
336
337 return shoppingItemField;
338 }
339
340
347 public ShoppingItemField fetchByPrimaryKey(Serializable primaryKey)
348 throws SystemException {
349 return fetchByPrimaryKey(((Long)primaryKey).longValue());
350 }
351
352
359 public ShoppingItemField fetchByPrimaryKey(long itemFieldId)
360 throws SystemException {
361 ShoppingItemField shoppingItemField = (ShoppingItemField)EntityCacheUtil.getResult(ShoppingItemFieldModelImpl.ENTITY_CACHE_ENABLED,
362 ShoppingItemFieldImpl.class, itemFieldId, this);
363
364 if (shoppingItemField == null) {
365 Session session = null;
366
367 try {
368 session = openSession();
369
370 shoppingItemField = (ShoppingItemField)session.get(ShoppingItemFieldImpl.class,
371 new Long(itemFieldId));
372 }
373 catch (Exception e) {
374 throw processException(e);
375 }
376 finally {
377 if (shoppingItemField != null) {
378 cacheResult(shoppingItemField);
379 }
380
381 closeSession(session);
382 }
383 }
384
385 return shoppingItemField;
386 }
387
388
395 public List<ShoppingItemField> findByItemId(long itemId)
396 throws SystemException {
397 return findByItemId(itemId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
398 }
399
400
413 public List<ShoppingItemField> findByItemId(long itemId, int start, int end)
414 throws SystemException {
415 return findByItemId(itemId, start, end, null);
416 }
417
418
432 public List<ShoppingItemField> findByItemId(long itemId, int start,
433 int end, OrderByComparator orderByComparator) throws SystemException {
434 Object[] finderArgs = new Object[] {
435 itemId,
436
437 String.valueOf(start), String.valueOf(end),
438 String.valueOf(orderByComparator)
439 };
440
441 List<ShoppingItemField> list = (List<ShoppingItemField>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_ITEMID,
442 finderArgs, this);
443
444 if (list == null) {
445 Session session = null;
446
447 try {
448 session = openSession();
449
450 StringBundler query = null;
451
452 if (orderByComparator != null) {
453 query = new StringBundler(3 +
454 (orderByComparator.getOrderByFields().length * 3));
455 }
456 else {
457 query = new StringBundler(3);
458 }
459
460 query.append(_SQL_SELECT_SHOPPINGITEMFIELD_WHERE);
461
462 query.append(_FINDER_COLUMN_ITEMID_ITEMID_2);
463
464 if (orderByComparator != null) {
465 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
466 orderByComparator);
467 }
468
469 else {
470 query.append(ShoppingItemFieldModelImpl.ORDER_BY_JPQL);
471 }
472
473 String sql = query.toString();
474
475 Query q = session.createQuery(sql);
476
477 QueryPos qPos = QueryPos.getInstance(q);
478
479 qPos.add(itemId);
480
481 list = (List<ShoppingItemField>)QueryUtil.list(q, getDialect(),
482 start, end);
483 }
484 catch (Exception e) {
485 throw processException(e);
486 }
487 finally {
488 if (list == null) {
489 list = new ArrayList<ShoppingItemField>();
490 }
491
492 cacheResult(list);
493
494 FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_ITEMID,
495 finderArgs, list);
496
497 closeSession(session);
498 }
499 }
500
501 return list;
502 }
503
504
517 public ShoppingItemField findByItemId_First(long itemId,
518 OrderByComparator orderByComparator)
519 throws NoSuchItemFieldException, SystemException {
520 List<ShoppingItemField> list = findByItemId(itemId, 0, 1,
521 orderByComparator);
522
523 if (list.isEmpty()) {
524 StringBundler msg = new StringBundler(4);
525
526 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
527
528 msg.append("itemId=");
529 msg.append(itemId);
530
531 msg.append(StringPool.CLOSE_CURLY_BRACE);
532
533 throw new NoSuchItemFieldException(msg.toString());
534 }
535 else {
536 return list.get(0);
537 }
538 }
539
540
553 public ShoppingItemField findByItemId_Last(long itemId,
554 OrderByComparator orderByComparator)
555 throws NoSuchItemFieldException, SystemException {
556 int count = countByItemId(itemId);
557
558 List<ShoppingItemField> list = findByItemId(itemId, count - 1, count,
559 orderByComparator);
560
561 if (list.isEmpty()) {
562 StringBundler msg = new StringBundler(4);
563
564 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
565
566 msg.append("itemId=");
567 msg.append(itemId);
568
569 msg.append(StringPool.CLOSE_CURLY_BRACE);
570
571 throw new NoSuchItemFieldException(msg.toString());
572 }
573 else {
574 return list.get(0);
575 }
576 }
577
578
592 public ShoppingItemField[] findByItemId_PrevAndNext(long itemFieldId,
593 long itemId, OrderByComparator orderByComparator)
594 throws NoSuchItemFieldException, SystemException {
595 ShoppingItemField shoppingItemField = findByPrimaryKey(itemFieldId);
596
597 Session session = null;
598
599 try {
600 session = openSession();
601
602 ShoppingItemField[] array = new ShoppingItemFieldImpl[3];
603
604 array[0] = getByItemId_PrevAndNext(session, shoppingItemField,
605 itemId, orderByComparator, true);
606
607 array[1] = shoppingItemField;
608
609 array[2] = getByItemId_PrevAndNext(session, shoppingItemField,
610 itemId, orderByComparator, false);
611
612 return array;
613 }
614 catch (Exception e) {
615 throw processException(e);
616 }
617 finally {
618 closeSession(session);
619 }
620 }
621
622 protected ShoppingItemField getByItemId_PrevAndNext(Session session,
623 ShoppingItemField shoppingItemField, long itemId,
624 OrderByComparator orderByComparator, boolean previous) {
625 StringBundler query = null;
626
627 if (orderByComparator != null) {
628 query = new StringBundler(6 +
629 (orderByComparator.getOrderByFields().length * 6));
630 }
631 else {
632 query = new StringBundler(3);
633 }
634
635 query.append(_SQL_SELECT_SHOPPINGITEMFIELD_WHERE);
636
637 query.append(_FINDER_COLUMN_ITEMID_ITEMID_2);
638
639 if (orderByComparator != null) {
640 String[] orderByFields = orderByComparator.getOrderByFields();
641
642 if (orderByFields.length > 0) {
643 query.append(WHERE_AND);
644 }
645
646 for (int i = 0; i < orderByFields.length; i++) {
647 query.append(_ORDER_BY_ENTITY_ALIAS);
648 query.append(orderByFields[i]);
649
650 if ((i + 1) < orderByFields.length) {
651 if (orderByComparator.isAscending() ^ previous) {
652 query.append(WHERE_GREATER_THAN_HAS_NEXT);
653 }
654 else {
655 query.append(WHERE_LESSER_THAN_HAS_NEXT);
656 }
657 }
658 else {
659 if (orderByComparator.isAscending() ^ previous) {
660 query.append(WHERE_GREATER_THAN);
661 }
662 else {
663 query.append(WHERE_LESSER_THAN);
664 }
665 }
666 }
667
668 query.append(ORDER_BY_CLAUSE);
669
670 for (int i = 0; i < orderByFields.length; i++) {
671 query.append(_ORDER_BY_ENTITY_ALIAS);
672 query.append(orderByFields[i]);
673
674 if ((i + 1) < orderByFields.length) {
675 if (orderByComparator.isAscending() ^ previous) {
676 query.append(ORDER_BY_ASC_HAS_NEXT);
677 }
678 else {
679 query.append(ORDER_BY_DESC_HAS_NEXT);
680 }
681 }
682 else {
683 if (orderByComparator.isAscending() ^ previous) {
684 query.append(ORDER_BY_ASC);
685 }
686 else {
687 query.append(ORDER_BY_DESC);
688 }
689 }
690 }
691 }
692
693 else {
694 query.append(ShoppingItemFieldModelImpl.ORDER_BY_JPQL);
695 }
696
697 String sql = query.toString();
698
699 Query q = session.createQuery(sql);
700
701 q.setFirstResult(0);
702 q.setMaxResults(2);
703
704 QueryPos qPos = QueryPos.getInstance(q);
705
706 qPos.add(itemId);
707
708 if (orderByComparator != null) {
709 Object[] values = orderByComparator.getOrderByValues(shoppingItemField);
710
711 for (Object value : values) {
712 qPos.add(value);
713 }
714 }
715
716 List<ShoppingItemField> list = q.list();
717
718 if (list.size() == 2) {
719 return list.get(1);
720 }
721 else {
722 return null;
723 }
724 }
725
726
732 public List<ShoppingItemField> findAll() throws SystemException {
733 return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
734 }
735
736
748 public List<ShoppingItemField> findAll(int start, int end)
749 throws SystemException {
750 return findAll(start, end, null);
751 }
752
753
766 public List<ShoppingItemField> findAll(int start, int end,
767 OrderByComparator orderByComparator) throws SystemException {
768 Object[] finderArgs = new Object[] {
769 String.valueOf(start), String.valueOf(end),
770 String.valueOf(orderByComparator)
771 };
772
773 List<ShoppingItemField> list = (List<ShoppingItemField>)FinderCacheUtil.getResult(FINDER_PATH_FIND_ALL,
774 finderArgs, this);
775
776 if (list == null) {
777 Session session = null;
778
779 try {
780 session = openSession();
781
782 StringBundler query = null;
783 String sql = null;
784
785 if (orderByComparator != null) {
786 query = new StringBundler(2 +
787 (orderByComparator.getOrderByFields().length * 3));
788
789 query.append(_SQL_SELECT_SHOPPINGITEMFIELD);
790
791 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
792 orderByComparator);
793
794 sql = query.toString();
795 }
796 else {
797 sql = _SQL_SELECT_SHOPPINGITEMFIELD.concat(ShoppingItemFieldModelImpl.ORDER_BY_JPQL);
798 }
799
800 Query q = session.createQuery(sql);
801
802 if (orderByComparator == null) {
803 list = (List<ShoppingItemField>)QueryUtil.list(q,
804 getDialect(), start, end, false);
805
806 Collections.sort(list);
807 }
808 else {
809 list = (List<ShoppingItemField>)QueryUtil.list(q,
810 getDialect(), start, end);
811 }
812 }
813 catch (Exception e) {
814 throw processException(e);
815 }
816 finally {
817 if (list == null) {
818 list = new ArrayList<ShoppingItemField>();
819 }
820
821 cacheResult(list);
822
823 FinderCacheUtil.putResult(FINDER_PATH_FIND_ALL, finderArgs, list);
824
825 closeSession(session);
826 }
827 }
828
829 return list;
830 }
831
832
838 public void removeByItemId(long itemId) throws SystemException {
839 for (ShoppingItemField shoppingItemField : findByItemId(itemId)) {
840 remove(shoppingItemField);
841 }
842 }
843
844
849 public void removeAll() throws SystemException {
850 for (ShoppingItemField shoppingItemField : findAll()) {
851 remove(shoppingItemField);
852 }
853 }
854
855
862 public int countByItemId(long itemId) throws SystemException {
863 Object[] finderArgs = new Object[] { itemId };
864
865 Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_ITEMID,
866 finderArgs, this);
867
868 if (count == null) {
869 Session session = null;
870
871 try {
872 session = openSession();
873
874 StringBundler query = new StringBundler(2);
875
876 query.append(_SQL_COUNT_SHOPPINGITEMFIELD_WHERE);
877
878 query.append(_FINDER_COLUMN_ITEMID_ITEMID_2);
879
880 String sql = query.toString();
881
882 Query q = session.createQuery(sql);
883
884 QueryPos qPos = QueryPos.getInstance(q);
885
886 qPos.add(itemId);
887
888 count = (Long)q.uniqueResult();
889 }
890 catch (Exception e) {
891 throw processException(e);
892 }
893 finally {
894 if (count == null) {
895 count = Long.valueOf(0);
896 }
897
898 FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_ITEMID,
899 finderArgs, count);
900
901 closeSession(session);
902 }
903 }
904
905 return count.intValue();
906 }
907
908
914 public int countAll() throws SystemException {
915 Object[] finderArgs = new Object[0];
916
917 Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_ALL,
918 finderArgs, this);
919
920 if (count == null) {
921 Session session = null;
922
923 try {
924 session = openSession();
925
926 Query q = session.createQuery(_SQL_COUNT_SHOPPINGITEMFIELD);
927
928 count = (Long)q.uniqueResult();
929 }
930 catch (Exception e) {
931 throw processException(e);
932 }
933 finally {
934 if (count == null) {
935 count = Long.valueOf(0);
936 }
937
938 FinderCacheUtil.putResult(FINDER_PATH_COUNT_ALL, finderArgs,
939 count);
940
941 closeSession(session);
942 }
943 }
944
945 return count.intValue();
946 }
947
948
951 public void afterPropertiesSet() {
952 String[] listenerClassNames = StringUtil.split(GetterUtil.getString(
953 com.liferay.portal.util.PropsUtil.get(
954 "value.object.listener.com.liferay.portlet.shopping.model.ShoppingItemField")));
955
956 if (listenerClassNames.length > 0) {
957 try {
958 List<ModelListener<ShoppingItemField>> listenersList = new ArrayList<ModelListener<ShoppingItemField>>();
959
960 for (String listenerClassName : listenerClassNames) {
961 listenersList.add((ModelListener<ShoppingItemField>)InstanceFactory.newInstance(
962 listenerClassName));
963 }
964
965 listeners = listenersList.toArray(new ModelListener[listenersList.size()]);
966 }
967 catch (Exception e) {
968 _log.error(e);
969 }
970 }
971 }
972
973 @BeanReference(type = ShoppingCartPersistence.class)
974 protected ShoppingCartPersistence shoppingCartPersistence;
975 @BeanReference(type = ShoppingCategoryPersistence.class)
976 protected ShoppingCategoryPersistence shoppingCategoryPersistence;
977 @BeanReference(type = ShoppingCouponPersistence.class)
978 protected ShoppingCouponPersistence shoppingCouponPersistence;
979 @BeanReference(type = ShoppingItemPersistence.class)
980 protected ShoppingItemPersistence shoppingItemPersistence;
981 @BeanReference(type = ShoppingItemFieldPersistence.class)
982 protected ShoppingItemFieldPersistence shoppingItemFieldPersistence;
983 @BeanReference(type = ShoppingItemPricePersistence.class)
984 protected ShoppingItemPricePersistence shoppingItemPricePersistence;
985 @BeanReference(type = ShoppingOrderPersistence.class)
986 protected ShoppingOrderPersistence shoppingOrderPersistence;
987 @BeanReference(type = ShoppingOrderItemPersistence.class)
988 protected ShoppingOrderItemPersistence shoppingOrderItemPersistence;
989 @BeanReference(type = ResourcePersistence.class)
990 protected ResourcePersistence resourcePersistence;
991 @BeanReference(type = UserPersistence.class)
992 protected UserPersistence userPersistence;
993 private static final String _SQL_SELECT_SHOPPINGITEMFIELD = "SELECT shoppingItemField FROM ShoppingItemField shoppingItemField";
994 private static final String _SQL_SELECT_SHOPPINGITEMFIELD_WHERE = "SELECT shoppingItemField FROM ShoppingItemField shoppingItemField WHERE ";
995 private static final String _SQL_COUNT_SHOPPINGITEMFIELD = "SELECT COUNT(shoppingItemField) FROM ShoppingItemField shoppingItemField";
996 private static final String _SQL_COUNT_SHOPPINGITEMFIELD_WHERE = "SELECT COUNT(shoppingItemField) FROM ShoppingItemField shoppingItemField WHERE ";
997 private static final String _FINDER_COLUMN_ITEMID_ITEMID_2 = "shoppingItemField.itemId = ?";
998 private static final String _ORDER_BY_ENTITY_ALIAS = "shoppingItemField.";
999 private static final String _NO_SUCH_ENTITY_WITH_PRIMARY_KEY = "No ShoppingItemField exists with the primary key ";
1000 private static final String _NO_SUCH_ENTITY_WITH_KEY = "No ShoppingItemField exists with the key {";
1001 private static Log _log = LogFactoryUtil.getLog(ShoppingItemFieldPersistenceImpl.class);
1002 }