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