001
014
015 package com.liferay.portal.service.persistence;
016
017 import com.liferay.portal.NoSuchModelException;
018 import com.liferay.portal.NoSuchPortletItemException;
019 import com.liferay.portal.kernel.annotation.BeanReference;
020 import com.liferay.portal.kernel.cache.CacheRegistryUtil;
021 import com.liferay.portal.kernel.dao.orm.EntityCacheUtil;
022 import com.liferay.portal.kernel.dao.orm.FinderCacheUtil;
023 import com.liferay.portal.kernel.dao.orm.FinderPath;
024 import com.liferay.portal.kernel.dao.orm.Query;
025 import com.liferay.portal.kernel.dao.orm.QueryPos;
026 import com.liferay.portal.kernel.dao.orm.QueryUtil;
027 import com.liferay.portal.kernel.dao.orm.Session;
028 import com.liferay.portal.kernel.exception.SystemException;
029 import com.liferay.portal.kernel.log.Log;
030 import com.liferay.portal.kernel.log.LogFactoryUtil;
031 import com.liferay.portal.kernel.util.GetterUtil;
032 import com.liferay.portal.kernel.util.InstanceFactory;
033 import com.liferay.portal.kernel.util.OrderByComparator;
034 import com.liferay.portal.kernel.util.StringBundler;
035 import com.liferay.portal.kernel.util.StringPool;
036 import com.liferay.portal.kernel.util.StringUtil;
037 import com.liferay.portal.kernel.util.Validator;
038 import com.liferay.portal.model.ModelListener;
039 import com.liferay.portal.model.PortletItem;
040 import com.liferay.portal.model.impl.PortletItemImpl;
041 import com.liferay.portal.model.impl.PortletItemModelImpl;
042 import com.liferay.portal.service.persistence.impl.BasePersistenceImpl;
043
044 import java.io.Serializable;
045
046 import java.util.ArrayList;
047 import java.util.Collections;
048 import java.util.List;
049
050
066 public class PortletItemPersistenceImpl extends BasePersistenceImpl<PortletItem>
067 implements PortletItemPersistence {
068 public static final String FINDER_CLASS_NAME_ENTITY = PortletItemImpl.class.getName();
069 public static final String FINDER_CLASS_NAME_LIST = FINDER_CLASS_NAME_ENTITY +
070 ".List";
071 public static final FinderPath FINDER_PATH_FIND_BY_G_C = new FinderPath(PortletItemModelImpl.ENTITY_CACHE_ENABLED,
072 PortletItemModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
073 "findByG_C",
074 new String[] {
075 Long.class.getName(), Long.class.getName(),
076
077 "java.lang.Integer", "java.lang.Integer",
078 "com.liferay.portal.kernel.util.OrderByComparator"
079 });
080 public static final FinderPath FINDER_PATH_COUNT_BY_G_C = new FinderPath(PortletItemModelImpl.ENTITY_CACHE_ENABLED,
081 PortletItemModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
082 "countByG_C",
083 new String[] { Long.class.getName(), Long.class.getName() });
084 public static final FinderPath FINDER_PATH_FIND_BY_G_P_C = new FinderPath(PortletItemModelImpl.ENTITY_CACHE_ENABLED,
085 PortletItemModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
086 "findByG_P_C",
087 new String[] {
088 Long.class.getName(), String.class.getName(),
089 Long.class.getName(),
090
091 "java.lang.Integer", "java.lang.Integer",
092 "com.liferay.portal.kernel.util.OrderByComparator"
093 });
094 public static final FinderPath FINDER_PATH_COUNT_BY_G_P_C = new FinderPath(PortletItemModelImpl.ENTITY_CACHE_ENABLED,
095 PortletItemModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
096 "countByG_P_C",
097 new String[] {
098 Long.class.getName(), String.class.getName(),
099 Long.class.getName()
100 });
101 public static final FinderPath FINDER_PATH_FETCH_BY_G_N_P_C = new FinderPath(PortletItemModelImpl.ENTITY_CACHE_ENABLED,
102 PortletItemModelImpl.FINDER_CACHE_ENABLED,
103 FINDER_CLASS_NAME_ENTITY, "fetchByG_N_P_C",
104 new String[] {
105 Long.class.getName(), String.class.getName(),
106 String.class.getName(), Long.class.getName()
107 });
108 public static final FinderPath FINDER_PATH_COUNT_BY_G_N_P_C = new FinderPath(PortletItemModelImpl.ENTITY_CACHE_ENABLED,
109 PortletItemModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
110 "countByG_N_P_C",
111 new String[] {
112 Long.class.getName(), String.class.getName(),
113 String.class.getName(), Long.class.getName()
114 });
115 public static final FinderPath FINDER_PATH_FIND_ALL = new FinderPath(PortletItemModelImpl.ENTITY_CACHE_ENABLED,
116 PortletItemModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
117 "findAll", new String[0]);
118 public static final FinderPath FINDER_PATH_COUNT_ALL = new FinderPath(PortletItemModelImpl.ENTITY_CACHE_ENABLED,
119 PortletItemModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
120 "countAll", new String[0]);
121
122
127 public void cacheResult(PortletItem portletItem) {
128 EntityCacheUtil.putResult(PortletItemModelImpl.ENTITY_CACHE_ENABLED,
129 PortletItemImpl.class, portletItem.getPrimaryKey(), portletItem);
130
131 FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_G_N_P_C,
132 new Object[] {
133 new Long(portletItem.getGroupId()),
134
135 portletItem.getName(),
136
137 portletItem.getPortletId(), new Long(portletItem.getClassNameId())
138 }, portletItem);
139 }
140
141
146 public void cacheResult(List<PortletItem> portletItems) {
147 for (PortletItem portletItem : portletItems) {
148 if (EntityCacheUtil.getResult(
149 PortletItemModelImpl.ENTITY_CACHE_ENABLED,
150 PortletItemImpl.class, portletItem.getPrimaryKey(), this) == null) {
151 cacheResult(portletItem);
152 }
153 }
154 }
155
156
163 public void clearCache() {
164 CacheRegistryUtil.clear(PortletItemImpl.class.getName());
165 EntityCacheUtil.clearCache(PortletItemImpl.class.getName());
166 FinderCacheUtil.clearCache(FINDER_CLASS_NAME_ENTITY);
167 FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST);
168 }
169
170
177 public void clearCache(PortletItem portletItem) {
178 EntityCacheUtil.removeResult(PortletItemModelImpl.ENTITY_CACHE_ENABLED,
179 PortletItemImpl.class, portletItem.getPrimaryKey());
180
181 FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_G_N_P_C,
182 new Object[] {
183 new Long(portletItem.getGroupId()),
184
185 portletItem.getName(),
186
187 portletItem.getPortletId(), new Long(portletItem.getClassNameId())
188 });
189 }
190
191
197 public PortletItem create(long portletItemId) {
198 PortletItem portletItem = new PortletItemImpl();
199
200 portletItem.setNew(true);
201 portletItem.setPrimaryKey(portletItemId);
202
203 return portletItem;
204 }
205
206
214 public PortletItem remove(Serializable primaryKey)
215 throws NoSuchModelException, SystemException {
216 return remove(((Long)primaryKey).longValue());
217 }
218
219
227 public PortletItem remove(long portletItemId)
228 throws NoSuchPortletItemException, SystemException {
229 Session session = null;
230
231 try {
232 session = openSession();
233
234 PortletItem portletItem = (PortletItem)session.get(PortletItemImpl.class,
235 new Long(portletItemId));
236
237 if (portletItem == null) {
238 if (_log.isWarnEnabled()) {
239 _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + portletItemId);
240 }
241
242 throw new NoSuchPortletItemException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
243 portletItemId);
244 }
245
246 return remove(portletItem);
247 }
248 catch (NoSuchPortletItemException nsee) {
249 throw nsee;
250 }
251 catch (Exception e) {
252 throw processException(e);
253 }
254 finally {
255 closeSession(session);
256 }
257 }
258
259 protected PortletItem removeImpl(PortletItem portletItem)
260 throws SystemException {
261 portletItem = toUnwrappedModel(portletItem);
262
263 Session session = null;
264
265 try {
266 session = openSession();
267
268 BatchSessionUtil.delete(session, portletItem);
269 }
270 catch (Exception e) {
271 throw processException(e);
272 }
273 finally {
274 closeSession(session);
275 }
276
277 FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST);
278
279 PortletItemModelImpl portletItemModelImpl = (PortletItemModelImpl)portletItem;
280
281 FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_G_N_P_C,
282 new Object[] {
283 new Long(portletItemModelImpl.getOriginalGroupId()),
284
285 portletItemModelImpl.getOriginalName(),
286
287 portletItemModelImpl.getOriginalPortletId(),
288 new Long(portletItemModelImpl.getOriginalClassNameId())
289 });
290
291 EntityCacheUtil.removeResult(PortletItemModelImpl.ENTITY_CACHE_ENABLED,
292 PortletItemImpl.class, portletItem.getPrimaryKey());
293
294 return portletItem;
295 }
296
297 public PortletItem updateImpl(
298 com.liferay.portal.model.PortletItem portletItem, boolean merge)
299 throws SystemException {
300 portletItem = toUnwrappedModel(portletItem);
301
302 boolean isNew = portletItem.isNew();
303
304 PortletItemModelImpl portletItemModelImpl = (PortletItemModelImpl)portletItem;
305
306 Session session = null;
307
308 try {
309 session = openSession();
310
311 BatchSessionUtil.update(session, portletItem, merge);
312
313 portletItem.setNew(false);
314 }
315 catch (Exception e) {
316 throw processException(e);
317 }
318 finally {
319 closeSession(session);
320 }
321
322 FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST);
323
324 EntityCacheUtil.putResult(PortletItemModelImpl.ENTITY_CACHE_ENABLED,
325 PortletItemImpl.class, portletItem.getPrimaryKey(), portletItem);
326
327 if (!isNew &&
328 ((portletItem.getGroupId() != portletItemModelImpl.getOriginalGroupId()) ||
329 !Validator.equals(portletItem.getName(),
330 portletItemModelImpl.getOriginalName()) ||
331 !Validator.equals(portletItem.getPortletId(),
332 portletItemModelImpl.getOriginalPortletId()) ||
333 (portletItem.getClassNameId() != portletItemModelImpl.getOriginalClassNameId()))) {
334 FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_G_N_P_C,
335 new Object[] {
336 new Long(portletItemModelImpl.getOriginalGroupId()),
337
338 portletItemModelImpl.getOriginalName(),
339
340 portletItemModelImpl.getOriginalPortletId(),
341 new Long(portletItemModelImpl.getOriginalClassNameId())
342 });
343 }
344
345 if (isNew ||
346 ((portletItem.getGroupId() != portletItemModelImpl.getOriginalGroupId()) ||
347 !Validator.equals(portletItem.getName(),
348 portletItemModelImpl.getOriginalName()) ||
349 !Validator.equals(portletItem.getPortletId(),
350 portletItemModelImpl.getOriginalPortletId()) ||
351 (portletItem.getClassNameId() != portletItemModelImpl.getOriginalClassNameId()))) {
352 FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_G_N_P_C,
353 new Object[] {
354 new Long(portletItem.getGroupId()),
355
356 portletItem.getName(),
357
358 portletItem.getPortletId(),
359 new Long(portletItem.getClassNameId())
360 }, portletItem);
361 }
362
363 return portletItem;
364 }
365
366 protected PortletItem toUnwrappedModel(PortletItem portletItem) {
367 if (portletItem instanceof PortletItemImpl) {
368 return portletItem;
369 }
370
371 PortletItemImpl portletItemImpl = new PortletItemImpl();
372
373 portletItemImpl.setNew(portletItem.isNew());
374 portletItemImpl.setPrimaryKey(portletItem.getPrimaryKey());
375
376 portletItemImpl.setPortletItemId(portletItem.getPortletItemId());
377 portletItemImpl.setGroupId(portletItem.getGroupId());
378 portletItemImpl.setCompanyId(portletItem.getCompanyId());
379 portletItemImpl.setUserId(portletItem.getUserId());
380 portletItemImpl.setUserName(portletItem.getUserName());
381 portletItemImpl.setCreateDate(portletItem.getCreateDate());
382 portletItemImpl.setModifiedDate(portletItem.getModifiedDate());
383 portletItemImpl.setName(portletItem.getName());
384 portletItemImpl.setPortletId(portletItem.getPortletId());
385 portletItemImpl.setClassNameId(portletItem.getClassNameId());
386
387 return portletItemImpl;
388 }
389
390
398 public PortletItem findByPrimaryKey(Serializable primaryKey)
399 throws NoSuchModelException, SystemException {
400 return findByPrimaryKey(((Long)primaryKey).longValue());
401 }
402
403
411 public PortletItem findByPrimaryKey(long portletItemId)
412 throws NoSuchPortletItemException, SystemException {
413 PortletItem portletItem = fetchByPrimaryKey(portletItemId);
414
415 if (portletItem == null) {
416 if (_log.isWarnEnabled()) {
417 _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + portletItemId);
418 }
419
420 throw new NoSuchPortletItemException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
421 portletItemId);
422 }
423
424 return portletItem;
425 }
426
427
434 public PortletItem fetchByPrimaryKey(Serializable primaryKey)
435 throws SystemException {
436 return fetchByPrimaryKey(((Long)primaryKey).longValue());
437 }
438
439
446 public PortletItem fetchByPrimaryKey(long portletItemId)
447 throws SystemException {
448 PortletItem portletItem = (PortletItem)EntityCacheUtil.getResult(PortletItemModelImpl.ENTITY_CACHE_ENABLED,
449 PortletItemImpl.class, portletItemId, this);
450
451 if (portletItem == null) {
452 Session session = null;
453
454 try {
455 session = openSession();
456
457 portletItem = (PortletItem)session.get(PortletItemImpl.class,
458 new Long(portletItemId));
459 }
460 catch (Exception e) {
461 throw processException(e);
462 }
463 finally {
464 if (portletItem != null) {
465 cacheResult(portletItem);
466 }
467
468 closeSession(session);
469 }
470 }
471
472 return portletItem;
473 }
474
475
483 public List<PortletItem> findByG_C(long groupId, long classNameId)
484 throws SystemException {
485 return findByG_C(groupId, classNameId, QueryUtil.ALL_POS,
486 QueryUtil.ALL_POS, null);
487 }
488
489
503 public List<PortletItem> findByG_C(long groupId, long classNameId,
504 int start, int end) throws SystemException {
505 return findByG_C(groupId, classNameId, start, end, null);
506 }
507
508
523 public List<PortletItem> findByG_C(long groupId, long classNameId,
524 int start, int end, OrderByComparator orderByComparator)
525 throws SystemException {
526 Object[] finderArgs = new Object[] {
527 groupId, classNameId,
528
529 String.valueOf(start), String.valueOf(end),
530 String.valueOf(orderByComparator)
531 };
532
533 List<PortletItem> list = (List<PortletItem>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_G_C,
534 finderArgs, this);
535
536 if (list == null) {
537 Session session = null;
538
539 try {
540 session = openSession();
541
542 StringBundler query = null;
543
544 if (orderByComparator != null) {
545 query = new StringBundler(4 +
546 (orderByComparator.getOrderByFields().length * 3));
547 }
548 else {
549 query = new StringBundler(3);
550 }
551
552 query.append(_SQL_SELECT_PORTLETITEM_WHERE);
553
554 query.append(_FINDER_COLUMN_G_C_GROUPID_2);
555
556 query.append(_FINDER_COLUMN_G_C_CLASSNAMEID_2);
557
558 if (orderByComparator != null) {
559 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
560 orderByComparator);
561 }
562
563 String sql = query.toString();
564
565 Query q = session.createQuery(sql);
566
567 QueryPos qPos = QueryPos.getInstance(q);
568
569 qPos.add(groupId);
570
571 qPos.add(classNameId);
572
573 list = (List<PortletItem>)QueryUtil.list(q, getDialect(),
574 start, end);
575 }
576 catch (Exception e) {
577 throw processException(e);
578 }
579 finally {
580 if (list == null) {
581 list = new ArrayList<PortletItem>();
582 }
583
584 cacheResult(list);
585
586 FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_G_C, finderArgs,
587 list);
588
589 closeSession(session);
590 }
591 }
592
593 return list;
594 }
595
596
610 public PortletItem findByG_C_First(long groupId, long classNameId,
611 OrderByComparator orderByComparator)
612 throws NoSuchPortletItemException, SystemException {
613 List<PortletItem> list = findByG_C(groupId, classNameId, 0, 1,
614 orderByComparator);
615
616 if (list.isEmpty()) {
617 StringBundler msg = new StringBundler(6);
618
619 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
620
621 msg.append("groupId=");
622 msg.append(groupId);
623
624 msg.append(", classNameId=");
625 msg.append(classNameId);
626
627 msg.append(StringPool.CLOSE_CURLY_BRACE);
628
629 throw new NoSuchPortletItemException(msg.toString());
630 }
631 else {
632 return list.get(0);
633 }
634 }
635
636
650 public PortletItem findByG_C_Last(long groupId, long classNameId,
651 OrderByComparator orderByComparator)
652 throws NoSuchPortletItemException, SystemException {
653 int count = countByG_C(groupId, classNameId);
654
655 List<PortletItem> list = findByG_C(groupId, classNameId, count - 1,
656 count, orderByComparator);
657
658 if (list.isEmpty()) {
659 StringBundler msg = new StringBundler(6);
660
661 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
662
663 msg.append("groupId=");
664 msg.append(groupId);
665
666 msg.append(", classNameId=");
667 msg.append(classNameId);
668
669 msg.append(StringPool.CLOSE_CURLY_BRACE);
670
671 throw new NoSuchPortletItemException(msg.toString());
672 }
673 else {
674 return list.get(0);
675 }
676 }
677
678
693 public PortletItem[] findByG_C_PrevAndNext(long portletItemId,
694 long groupId, long classNameId, OrderByComparator orderByComparator)
695 throws NoSuchPortletItemException, SystemException {
696 PortletItem portletItem = findByPrimaryKey(portletItemId);
697
698 Session session = null;
699
700 try {
701 session = openSession();
702
703 PortletItem[] array = new PortletItemImpl[3];
704
705 array[0] = getByG_C_PrevAndNext(session, portletItem, groupId,
706 classNameId, orderByComparator, true);
707
708 array[1] = portletItem;
709
710 array[2] = getByG_C_PrevAndNext(session, portletItem, groupId,
711 classNameId, orderByComparator, false);
712
713 return array;
714 }
715 catch (Exception e) {
716 throw processException(e);
717 }
718 finally {
719 closeSession(session);
720 }
721 }
722
723 protected PortletItem getByG_C_PrevAndNext(Session session,
724 PortletItem portletItem, long groupId, long classNameId,
725 OrderByComparator orderByComparator, boolean previous) {
726 StringBundler query = null;
727
728 if (orderByComparator != null) {
729 query = new StringBundler(6 +
730 (orderByComparator.getOrderByFields().length * 6));
731 }
732 else {
733 query = new StringBundler(3);
734 }
735
736 query.append(_SQL_SELECT_PORTLETITEM_WHERE);
737
738 query.append(_FINDER_COLUMN_G_C_GROUPID_2);
739
740 query.append(_FINDER_COLUMN_G_C_CLASSNAMEID_2);
741
742 if (orderByComparator != null) {
743 String[] orderByFields = orderByComparator.getOrderByFields();
744
745 if (orderByFields.length > 0) {
746 query.append(WHERE_AND);
747 }
748
749 for (int i = 0; i < orderByFields.length; i++) {
750 query.append(_ORDER_BY_ENTITY_ALIAS);
751 query.append(orderByFields[i]);
752
753 if ((i + 1) < orderByFields.length) {
754 if (orderByComparator.isAscending() ^ previous) {
755 query.append(WHERE_GREATER_THAN_HAS_NEXT);
756 }
757 else {
758 query.append(WHERE_LESSER_THAN_HAS_NEXT);
759 }
760 }
761 else {
762 if (orderByComparator.isAscending() ^ previous) {
763 query.append(WHERE_GREATER_THAN);
764 }
765 else {
766 query.append(WHERE_LESSER_THAN);
767 }
768 }
769 }
770
771 query.append(ORDER_BY_CLAUSE);
772
773 for (int i = 0; i < orderByFields.length; i++) {
774 query.append(_ORDER_BY_ENTITY_ALIAS);
775 query.append(orderByFields[i]);
776
777 if ((i + 1) < orderByFields.length) {
778 if (orderByComparator.isAscending() ^ previous) {
779 query.append(ORDER_BY_ASC_HAS_NEXT);
780 }
781 else {
782 query.append(ORDER_BY_DESC_HAS_NEXT);
783 }
784 }
785 else {
786 if (orderByComparator.isAscending() ^ previous) {
787 query.append(ORDER_BY_ASC);
788 }
789 else {
790 query.append(ORDER_BY_DESC);
791 }
792 }
793 }
794 }
795
796 String sql = query.toString();
797
798 Query q = session.createQuery(sql);
799
800 q.setFirstResult(0);
801 q.setMaxResults(2);
802
803 QueryPos qPos = QueryPos.getInstance(q);
804
805 qPos.add(groupId);
806
807 qPos.add(classNameId);
808
809 if (orderByComparator != null) {
810 Object[] values = orderByComparator.getOrderByValues(portletItem);
811
812 for (Object value : values) {
813 qPos.add(value);
814 }
815 }
816
817 List<PortletItem> list = q.list();
818
819 if (list.size() == 2) {
820 return list.get(1);
821 }
822 else {
823 return null;
824 }
825 }
826
827
836 public List<PortletItem> findByG_P_C(long groupId, String portletId,
837 long classNameId) throws SystemException {
838 return findByG_P_C(groupId, portletId, classNameId, QueryUtil.ALL_POS,
839 QueryUtil.ALL_POS, null);
840 }
841
842
857 public List<PortletItem> findByG_P_C(long groupId, String portletId,
858 long classNameId, int start, int end) throws SystemException {
859 return findByG_P_C(groupId, portletId, classNameId, start, end, null);
860 }
861
862
878 public List<PortletItem> findByG_P_C(long groupId, String portletId,
879 long classNameId, int start, int end,
880 OrderByComparator orderByComparator) throws SystemException {
881 Object[] finderArgs = new Object[] {
882 groupId, portletId, classNameId,
883
884 String.valueOf(start), String.valueOf(end),
885 String.valueOf(orderByComparator)
886 };
887
888 List<PortletItem> list = (List<PortletItem>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_G_P_C,
889 finderArgs, this);
890
891 if (list == null) {
892 Session session = null;
893
894 try {
895 session = openSession();
896
897 StringBundler query = null;
898
899 if (orderByComparator != null) {
900 query = new StringBundler(5 +
901 (orderByComparator.getOrderByFields().length * 3));
902 }
903 else {
904 query = new StringBundler(4);
905 }
906
907 query.append(_SQL_SELECT_PORTLETITEM_WHERE);
908
909 query.append(_FINDER_COLUMN_G_P_C_GROUPID_2);
910
911 if (portletId == null) {
912 query.append(_FINDER_COLUMN_G_P_C_PORTLETID_1);
913 }
914 else {
915 if (portletId.equals(StringPool.BLANK)) {
916 query.append(_FINDER_COLUMN_G_P_C_PORTLETID_3);
917 }
918 else {
919 query.append(_FINDER_COLUMN_G_P_C_PORTLETID_2);
920 }
921 }
922
923 query.append(_FINDER_COLUMN_G_P_C_CLASSNAMEID_2);
924
925 if (orderByComparator != null) {
926 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
927 orderByComparator);
928 }
929
930 String sql = query.toString();
931
932 Query q = session.createQuery(sql);
933
934 QueryPos qPos = QueryPos.getInstance(q);
935
936 qPos.add(groupId);
937
938 if (portletId != null) {
939 qPos.add(portletId);
940 }
941
942 qPos.add(classNameId);
943
944 list = (List<PortletItem>)QueryUtil.list(q, getDialect(),
945 start, end);
946 }
947 catch (Exception e) {
948 throw processException(e);
949 }
950 finally {
951 if (list == null) {
952 list = new ArrayList<PortletItem>();
953 }
954
955 cacheResult(list);
956
957 FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_G_P_C,
958 finderArgs, list);
959
960 closeSession(session);
961 }
962 }
963
964 return list;
965 }
966
967
982 public PortletItem findByG_P_C_First(long groupId, String portletId,
983 long classNameId, OrderByComparator orderByComparator)
984 throws NoSuchPortletItemException, SystemException {
985 List<PortletItem> list = findByG_P_C(groupId, portletId, classNameId,
986 0, 1, orderByComparator);
987
988 if (list.isEmpty()) {
989 StringBundler msg = new StringBundler(8);
990
991 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
992
993 msg.append("groupId=");
994 msg.append(groupId);
995
996 msg.append(", portletId=");
997 msg.append(portletId);
998
999 msg.append(", classNameId=");
1000 msg.append(classNameId);
1001
1002 msg.append(StringPool.CLOSE_CURLY_BRACE);
1003
1004 throw new NoSuchPortletItemException(msg.toString());
1005 }
1006 else {
1007 return list.get(0);
1008 }
1009 }
1010
1011
1026 public PortletItem findByG_P_C_Last(long groupId, String portletId,
1027 long classNameId, OrderByComparator orderByComparator)
1028 throws NoSuchPortletItemException, SystemException {
1029 int count = countByG_P_C(groupId, portletId, classNameId);
1030
1031 List<PortletItem> list = findByG_P_C(groupId, portletId, classNameId,
1032 count - 1, count, orderByComparator);
1033
1034 if (list.isEmpty()) {
1035 StringBundler msg = new StringBundler(8);
1036
1037 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
1038
1039 msg.append("groupId=");
1040 msg.append(groupId);
1041
1042 msg.append(", portletId=");
1043 msg.append(portletId);
1044
1045 msg.append(", classNameId=");
1046 msg.append(classNameId);
1047
1048 msg.append(StringPool.CLOSE_CURLY_BRACE);
1049
1050 throw new NoSuchPortletItemException(msg.toString());
1051 }
1052 else {
1053 return list.get(0);
1054 }
1055 }
1056
1057
1073 public PortletItem[] findByG_P_C_PrevAndNext(long portletItemId,
1074 long groupId, String portletId, long classNameId,
1075 OrderByComparator orderByComparator)
1076 throws NoSuchPortletItemException, SystemException {
1077 PortletItem portletItem = findByPrimaryKey(portletItemId);
1078
1079 Session session = null;
1080
1081 try {
1082 session = openSession();
1083
1084 PortletItem[] array = new PortletItemImpl[3];
1085
1086 array[0] = getByG_P_C_PrevAndNext(session, portletItem, groupId,
1087 portletId, classNameId, orderByComparator, true);
1088
1089 array[1] = portletItem;
1090
1091 array[2] = getByG_P_C_PrevAndNext(session, portletItem, groupId,
1092 portletId, classNameId, orderByComparator, false);
1093
1094 return array;
1095 }
1096 catch (Exception e) {
1097 throw processException(e);
1098 }
1099 finally {
1100 closeSession(session);
1101 }
1102 }
1103
1104 protected PortletItem getByG_P_C_PrevAndNext(Session session,
1105 PortletItem portletItem, long groupId, String portletId,
1106 long classNameId, OrderByComparator orderByComparator, boolean previous) {
1107 StringBundler query = null;
1108
1109 if (orderByComparator != null) {
1110 query = new StringBundler(6 +
1111 (orderByComparator.getOrderByFields().length * 6));
1112 }
1113 else {
1114 query = new StringBundler(3);
1115 }
1116
1117 query.append(_SQL_SELECT_PORTLETITEM_WHERE);
1118
1119 query.append(_FINDER_COLUMN_G_P_C_GROUPID_2);
1120
1121 if (portletId == null) {
1122 query.append(_FINDER_COLUMN_G_P_C_PORTLETID_1);
1123 }
1124 else {
1125 if (portletId.equals(StringPool.BLANK)) {
1126 query.append(_FINDER_COLUMN_G_P_C_PORTLETID_3);
1127 }
1128 else {
1129 query.append(_FINDER_COLUMN_G_P_C_PORTLETID_2);
1130 }
1131 }
1132
1133 query.append(_FINDER_COLUMN_G_P_C_CLASSNAMEID_2);
1134
1135 if (orderByComparator != null) {
1136 String[] orderByFields = orderByComparator.getOrderByFields();
1137
1138 if (orderByFields.length > 0) {
1139 query.append(WHERE_AND);
1140 }
1141
1142 for (int i = 0; i < orderByFields.length; i++) {
1143 query.append(_ORDER_BY_ENTITY_ALIAS);
1144 query.append(orderByFields[i]);
1145
1146 if ((i + 1) < orderByFields.length) {
1147 if (orderByComparator.isAscending() ^ previous) {
1148 query.append(WHERE_GREATER_THAN_HAS_NEXT);
1149 }
1150 else {
1151 query.append(WHERE_LESSER_THAN_HAS_NEXT);
1152 }
1153 }
1154 else {
1155 if (orderByComparator.isAscending() ^ previous) {
1156 query.append(WHERE_GREATER_THAN);
1157 }
1158 else {
1159 query.append(WHERE_LESSER_THAN);
1160 }
1161 }
1162 }
1163
1164 query.append(ORDER_BY_CLAUSE);
1165
1166 for (int i = 0; i < orderByFields.length; i++) {
1167 query.append(_ORDER_BY_ENTITY_ALIAS);
1168 query.append(orderByFields[i]);
1169
1170 if ((i + 1) < orderByFields.length) {
1171 if (orderByComparator.isAscending() ^ previous) {
1172 query.append(ORDER_BY_ASC_HAS_NEXT);
1173 }
1174 else {
1175 query.append(ORDER_BY_DESC_HAS_NEXT);
1176 }
1177 }
1178 else {
1179 if (orderByComparator.isAscending() ^ previous) {
1180 query.append(ORDER_BY_ASC);
1181 }
1182 else {
1183 query.append(ORDER_BY_DESC);
1184 }
1185 }
1186 }
1187 }
1188
1189 String sql = query.toString();
1190
1191 Query q = session.createQuery(sql);
1192
1193 q.setFirstResult(0);
1194 q.setMaxResults(2);
1195
1196 QueryPos qPos = QueryPos.getInstance(q);
1197
1198 qPos.add(groupId);
1199
1200 if (portletId != null) {
1201 qPos.add(portletId);
1202 }
1203
1204 qPos.add(classNameId);
1205
1206 if (orderByComparator != null) {
1207 Object[] values = orderByComparator.getOrderByValues(portletItem);
1208
1209 for (Object value : values) {
1210 qPos.add(value);
1211 }
1212 }
1213
1214 List<PortletItem> list = q.list();
1215
1216 if (list.size() == 2) {
1217 return list.get(1);
1218 }
1219 else {
1220 return null;
1221 }
1222 }
1223
1224
1235 public PortletItem findByG_N_P_C(long groupId, String name,
1236 String portletId, long classNameId)
1237 throws NoSuchPortletItemException, SystemException {
1238 PortletItem portletItem = fetchByG_N_P_C(groupId, name, portletId,
1239 classNameId);
1240
1241 if (portletItem == null) {
1242 StringBundler msg = new StringBundler(10);
1243
1244 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
1245
1246 msg.append("groupId=");
1247 msg.append(groupId);
1248
1249 msg.append(", name=");
1250 msg.append(name);
1251
1252 msg.append(", portletId=");
1253 msg.append(portletId);
1254
1255 msg.append(", classNameId=");
1256 msg.append(classNameId);
1257
1258 msg.append(StringPool.CLOSE_CURLY_BRACE);
1259
1260 if (_log.isWarnEnabled()) {
1261 _log.warn(msg.toString());
1262 }
1263
1264 throw new NoSuchPortletItemException(msg.toString());
1265 }
1266
1267 return portletItem;
1268 }
1269
1270
1280 public PortletItem fetchByG_N_P_C(long groupId, String name,
1281 String portletId, long classNameId) throws SystemException {
1282 return fetchByG_N_P_C(groupId, name, portletId, classNameId, true);
1283 }
1284
1285
1295 public PortletItem fetchByG_N_P_C(long groupId, String name,
1296 String portletId, long classNameId, boolean retrieveFromCache)
1297 throws SystemException {
1298 Object[] finderArgs = new Object[] { groupId, name, portletId, classNameId };
1299
1300 Object result = null;
1301
1302 if (retrieveFromCache) {
1303 result = FinderCacheUtil.getResult(FINDER_PATH_FETCH_BY_G_N_P_C,
1304 finderArgs, this);
1305 }
1306
1307 if (result == null) {
1308 Session session = null;
1309
1310 try {
1311 session = openSession();
1312
1313 StringBundler query = new StringBundler(5);
1314
1315 query.append(_SQL_SELECT_PORTLETITEM_WHERE);
1316
1317 query.append(_FINDER_COLUMN_G_N_P_C_GROUPID_2);
1318
1319 if (name == null) {
1320 query.append(_FINDER_COLUMN_G_N_P_C_NAME_1);
1321 }
1322 else {
1323 if (name.equals(StringPool.BLANK)) {
1324 query.append(_FINDER_COLUMN_G_N_P_C_NAME_3);
1325 }
1326 else {
1327 query.append(_FINDER_COLUMN_G_N_P_C_NAME_2);
1328 }
1329 }
1330
1331 if (portletId == null) {
1332 query.append(_FINDER_COLUMN_G_N_P_C_PORTLETID_1);
1333 }
1334 else {
1335 if (portletId.equals(StringPool.BLANK)) {
1336 query.append(_FINDER_COLUMN_G_N_P_C_PORTLETID_3);
1337 }
1338 else {
1339 query.append(_FINDER_COLUMN_G_N_P_C_PORTLETID_2);
1340 }
1341 }
1342
1343 query.append(_FINDER_COLUMN_G_N_P_C_CLASSNAMEID_2);
1344
1345 String sql = query.toString();
1346
1347 Query q = session.createQuery(sql);
1348
1349 QueryPos qPos = QueryPos.getInstance(q);
1350
1351 qPos.add(groupId);
1352
1353 if (name != null) {
1354 qPos.add(name);
1355 }
1356
1357 if (portletId != null) {
1358 qPos.add(portletId);
1359 }
1360
1361 qPos.add(classNameId);
1362
1363 List<PortletItem> list = q.list();
1364
1365 result = list;
1366
1367 PortletItem portletItem = null;
1368
1369 if (list.isEmpty()) {
1370 FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_G_N_P_C,
1371 finderArgs, list);
1372 }
1373 else {
1374 portletItem = list.get(0);
1375
1376 cacheResult(portletItem);
1377
1378 if ((portletItem.getGroupId() != groupId) ||
1379 (portletItem.getName() == null) ||
1380 !portletItem.getName().equals(name) ||
1381 (portletItem.getPortletId() == null) ||
1382 !portletItem.getPortletId().equals(portletId) ||
1383 (portletItem.getClassNameId() != classNameId)) {
1384 FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_G_N_P_C,
1385 finderArgs, portletItem);
1386 }
1387 }
1388
1389 return portletItem;
1390 }
1391 catch (Exception e) {
1392 throw processException(e);
1393 }
1394 finally {
1395 if (result == null) {
1396 FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_G_N_P_C,
1397 finderArgs, new ArrayList<PortletItem>());
1398 }
1399
1400 closeSession(session);
1401 }
1402 }
1403 else {
1404 if (result instanceof List<?>) {
1405 return null;
1406 }
1407 else {
1408 return (PortletItem)result;
1409 }
1410 }
1411 }
1412
1413
1419 public List<PortletItem> findAll() throws SystemException {
1420 return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
1421 }
1422
1423
1435 public List<PortletItem> findAll(int start, int end)
1436 throws SystemException {
1437 return findAll(start, end, null);
1438 }
1439
1440
1453 public List<PortletItem> findAll(int start, int end,
1454 OrderByComparator orderByComparator) throws SystemException {
1455 Object[] finderArgs = new Object[] {
1456 String.valueOf(start), String.valueOf(end),
1457 String.valueOf(orderByComparator)
1458 };
1459
1460 List<PortletItem> list = (List<PortletItem>)FinderCacheUtil.getResult(FINDER_PATH_FIND_ALL,
1461 finderArgs, this);
1462
1463 if (list == null) {
1464 Session session = null;
1465
1466 try {
1467 session = openSession();
1468
1469 StringBundler query = null;
1470 String sql = null;
1471
1472 if (orderByComparator != null) {
1473 query = new StringBundler(2 +
1474 (orderByComparator.getOrderByFields().length * 3));
1475
1476 query.append(_SQL_SELECT_PORTLETITEM);
1477
1478 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
1479 orderByComparator);
1480
1481 sql = query.toString();
1482 }
1483 else {
1484 sql = _SQL_SELECT_PORTLETITEM;
1485 }
1486
1487 Query q = session.createQuery(sql);
1488
1489 if (orderByComparator == null) {
1490 list = (List<PortletItem>)QueryUtil.list(q, getDialect(),
1491 start, end, false);
1492
1493 Collections.sort(list);
1494 }
1495 else {
1496 list = (List<PortletItem>)QueryUtil.list(q, getDialect(),
1497 start, end);
1498 }
1499 }
1500 catch (Exception e) {
1501 throw processException(e);
1502 }
1503 finally {
1504 if (list == null) {
1505 list = new ArrayList<PortletItem>();
1506 }
1507
1508 cacheResult(list);
1509
1510 FinderCacheUtil.putResult(FINDER_PATH_FIND_ALL, finderArgs, list);
1511
1512 closeSession(session);
1513 }
1514 }
1515
1516 return list;
1517 }
1518
1519
1526 public void removeByG_C(long groupId, long classNameId)
1527 throws SystemException {
1528 for (PortletItem portletItem : findByG_C(groupId, classNameId)) {
1529 remove(portletItem);
1530 }
1531 }
1532
1533
1541 public void removeByG_P_C(long groupId, String portletId, long classNameId)
1542 throws SystemException {
1543 for (PortletItem portletItem : findByG_P_C(groupId, portletId,
1544 classNameId)) {
1545 remove(portletItem);
1546 }
1547 }
1548
1549
1558 public void removeByG_N_P_C(long groupId, String name, String portletId,
1559 long classNameId) throws NoSuchPortletItemException, SystemException {
1560 PortletItem portletItem = findByG_N_P_C(groupId, name, portletId,
1561 classNameId);
1562
1563 remove(portletItem);
1564 }
1565
1566
1571 public void removeAll() throws SystemException {
1572 for (PortletItem portletItem : findAll()) {
1573 remove(portletItem);
1574 }
1575 }
1576
1577
1585 public int countByG_C(long groupId, long classNameId)
1586 throws SystemException {
1587 Object[] finderArgs = new Object[] { groupId, classNameId };
1588
1589 Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_G_C,
1590 finderArgs, this);
1591
1592 if (count == null) {
1593 Session session = null;
1594
1595 try {
1596 session = openSession();
1597
1598 StringBundler query = new StringBundler(3);
1599
1600 query.append(_SQL_COUNT_PORTLETITEM_WHERE);
1601
1602 query.append(_FINDER_COLUMN_G_C_GROUPID_2);
1603
1604 query.append(_FINDER_COLUMN_G_C_CLASSNAMEID_2);
1605
1606 String sql = query.toString();
1607
1608 Query q = session.createQuery(sql);
1609
1610 QueryPos qPos = QueryPos.getInstance(q);
1611
1612 qPos.add(groupId);
1613
1614 qPos.add(classNameId);
1615
1616 count = (Long)q.uniqueResult();
1617 }
1618 catch (Exception e) {
1619 throw processException(e);
1620 }
1621 finally {
1622 if (count == null) {
1623 count = Long.valueOf(0);
1624 }
1625
1626 FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_G_C, finderArgs,
1627 count);
1628
1629 closeSession(session);
1630 }
1631 }
1632
1633 return count.intValue();
1634 }
1635
1636
1645 public int countByG_P_C(long groupId, String portletId, long classNameId)
1646 throws SystemException {
1647 Object[] finderArgs = new Object[] { groupId, portletId, classNameId };
1648
1649 Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_G_P_C,
1650 finderArgs, this);
1651
1652 if (count == null) {
1653 Session session = null;
1654
1655 try {
1656 session = openSession();
1657
1658 StringBundler query = new StringBundler(4);
1659
1660 query.append(_SQL_COUNT_PORTLETITEM_WHERE);
1661
1662 query.append(_FINDER_COLUMN_G_P_C_GROUPID_2);
1663
1664 if (portletId == null) {
1665 query.append(_FINDER_COLUMN_G_P_C_PORTLETID_1);
1666 }
1667 else {
1668 if (portletId.equals(StringPool.BLANK)) {
1669 query.append(_FINDER_COLUMN_G_P_C_PORTLETID_3);
1670 }
1671 else {
1672 query.append(_FINDER_COLUMN_G_P_C_PORTLETID_2);
1673 }
1674 }
1675
1676 query.append(_FINDER_COLUMN_G_P_C_CLASSNAMEID_2);
1677
1678 String sql = query.toString();
1679
1680 Query q = session.createQuery(sql);
1681
1682 QueryPos qPos = QueryPos.getInstance(q);
1683
1684 qPos.add(groupId);
1685
1686 if (portletId != null) {
1687 qPos.add(portletId);
1688 }
1689
1690 qPos.add(classNameId);
1691
1692 count = (Long)q.uniqueResult();
1693 }
1694 catch (Exception e) {
1695 throw processException(e);
1696 }
1697 finally {
1698 if (count == null) {
1699 count = Long.valueOf(0);
1700 }
1701
1702 FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_G_P_C,
1703 finderArgs, count);
1704
1705 closeSession(session);
1706 }
1707 }
1708
1709 return count.intValue();
1710 }
1711
1712
1722 public int countByG_N_P_C(long groupId, String name, String portletId,
1723 long classNameId) throws SystemException {
1724 Object[] finderArgs = new Object[] { groupId, name, portletId, classNameId };
1725
1726 Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_G_N_P_C,
1727 finderArgs, this);
1728
1729 if (count == null) {
1730 Session session = null;
1731
1732 try {
1733 session = openSession();
1734
1735 StringBundler query = new StringBundler(5);
1736
1737 query.append(_SQL_COUNT_PORTLETITEM_WHERE);
1738
1739 query.append(_FINDER_COLUMN_G_N_P_C_GROUPID_2);
1740
1741 if (name == null) {
1742 query.append(_FINDER_COLUMN_G_N_P_C_NAME_1);
1743 }
1744 else {
1745 if (name.equals(StringPool.BLANK)) {
1746 query.append(_FINDER_COLUMN_G_N_P_C_NAME_3);
1747 }
1748 else {
1749 query.append(_FINDER_COLUMN_G_N_P_C_NAME_2);
1750 }
1751 }
1752
1753 if (portletId == null) {
1754 query.append(_FINDER_COLUMN_G_N_P_C_PORTLETID_1);
1755 }
1756 else {
1757 if (portletId.equals(StringPool.BLANK)) {
1758 query.append(_FINDER_COLUMN_G_N_P_C_PORTLETID_3);
1759 }
1760 else {
1761 query.append(_FINDER_COLUMN_G_N_P_C_PORTLETID_2);
1762 }
1763 }
1764
1765 query.append(_FINDER_COLUMN_G_N_P_C_CLASSNAMEID_2);
1766
1767 String sql = query.toString();
1768
1769 Query q = session.createQuery(sql);
1770
1771 QueryPos qPos = QueryPos.getInstance(q);
1772
1773 qPos.add(groupId);
1774
1775 if (name != null) {
1776 qPos.add(name);
1777 }
1778
1779 if (portletId != null) {
1780 qPos.add(portletId);
1781 }
1782
1783 qPos.add(classNameId);
1784
1785 count = (Long)q.uniqueResult();
1786 }
1787 catch (Exception e) {
1788 throw processException(e);
1789 }
1790 finally {
1791 if (count == null) {
1792 count = Long.valueOf(0);
1793 }
1794
1795 FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_G_N_P_C,
1796 finderArgs, count);
1797
1798 closeSession(session);
1799 }
1800 }
1801
1802 return count.intValue();
1803 }
1804
1805
1811 public int countAll() throws SystemException {
1812 Object[] finderArgs = new Object[0];
1813
1814 Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_ALL,
1815 finderArgs, this);
1816
1817 if (count == null) {
1818 Session session = null;
1819
1820 try {
1821 session = openSession();
1822
1823 Query q = session.createQuery(_SQL_COUNT_PORTLETITEM);
1824
1825 count = (Long)q.uniqueResult();
1826 }
1827 catch (Exception e) {
1828 throw processException(e);
1829 }
1830 finally {
1831 if (count == null) {
1832 count = Long.valueOf(0);
1833 }
1834
1835 FinderCacheUtil.putResult(FINDER_PATH_COUNT_ALL, finderArgs,
1836 count);
1837
1838 closeSession(session);
1839 }
1840 }
1841
1842 return count.intValue();
1843 }
1844
1845
1848 public void afterPropertiesSet() {
1849 String[] listenerClassNames = StringUtil.split(GetterUtil.getString(
1850 com.liferay.portal.util.PropsUtil.get(
1851 "value.object.listener.com.liferay.portal.model.PortletItem")));
1852
1853 if (listenerClassNames.length > 0) {
1854 try {
1855 List<ModelListener<PortletItem>> listenersList = new ArrayList<ModelListener<PortletItem>>();
1856
1857 for (String listenerClassName : listenerClassNames) {
1858 listenersList.add((ModelListener<PortletItem>)InstanceFactory.newInstance(
1859 listenerClassName));
1860 }
1861
1862 listeners = listenersList.toArray(new ModelListener[listenersList.size()]);
1863 }
1864 catch (Exception e) {
1865 _log.error(e);
1866 }
1867 }
1868 }
1869
1870 public void destroy() {
1871 EntityCacheUtil.removeCache(PortletItemImpl.class.getName());
1872 FinderCacheUtil.removeCache(FINDER_CLASS_NAME_ENTITY);
1873 FinderCacheUtil.removeCache(FINDER_CLASS_NAME_LIST);
1874 }
1875
1876 @BeanReference(type = AccountPersistence.class)
1877 protected AccountPersistence accountPersistence;
1878 @BeanReference(type = AddressPersistence.class)
1879 protected AddressPersistence addressPersistence;
1880 @BeanReference(type = BrowserTrackerPersistence.class)
1881 protected BrowserTrackerPersistence browserTrackerPersistence;
1882 @BeanReference(type = ClassNamePersistence.class)
1883 protected ClassNamePersistence classNamePersistence;
1884 @BeanReference(type = ClusterGroupPersistence.class)
1885 protected ClusterGroupPersistence clusterGroupPersistence;
1886 @BeanReference(type = CompanyPersistence.class)
1887 protected CompanyPersistence companyPersistence;
1888 @BeanReference(type = ContactPersistence.class)
1889 protected ContactPersistence contactPersistence;
1890 @BeanReference(type = CountryPersistence.class)
1891 protected CountryPersistence countryPersistence;
1892 @BeanReference(type = EmailAddressPersistence.class)
1893 protected EmailAddressPersistence emailAddressPersistence;
1894 @BeanReference(type = GroupPersistence.class)
1895 protected GroupPersistence groupPersistence;
1896 @BeanReference(type = ImagePersistence.class)
1897 protected ImagePersistence imagePersistence;
1898 @BeanReference(type = LayoutPersistence.class)
1899 protected LayoutPersistence layoutPersistence;
1900 @BeanReference(type = LayoutPrototypePersistence.class)
1901 protected LayoutPrototypePersistence layoutPrototypePersistence;
1902 @BeanReference(type = LayoutSetPersistence.class)
1903 protected LayoutSetPersistence layoutSetPersistence;
1904 @BeanReference(type = LayoutSetPrototypePersistence.class)
1905 protected LayoutSetPrototypePersistence layoutSetPrototypePersistence;
1906 @BeanReference(type = ListTypePersistence.class)
1907 protected ListTypePersistence listTypePersistence;
1908 @BeanReference(type = LockPersistence.class)
1909 protected LockPersistence lockPersistence;
1910 @BeanReference(type = MembershipRequestPersistence.class)
1911 protected MembershipRequestPersistence membershipRequestPersistence;
1912 @BeanReference(type = OrganizationPersistence.class)
1913 protected OrganizationPersistence organizationPersistence;
1914 @BeanReference(type = OrgGroupPermissionPersistence.class)
1915 protected OrgGroupPermissionPersistence orgGroupPermissionPersistence;
1916 @BeanReference(type = OrgGroupRolePersistence.class)
1917 protected OrgGroupRolePersistence orgGroupRolePersistence;
1918 @BeanReference(type = OrgLaborPersistence.class)
1919 protected OrgLaborPersistence orgLaborPersistence;
1920 @BeanReference(type = PasswordPolicyPersistence.class)
1921 protected PasswordPolicyPersistence passwordPolicyPersistence;
1922 @BeanReference(type = PasswordPolicyRelPersistence.class)
1923 protected PasswordPolicyRelPersistence passwordPolicyRelPersistence;
1924 @BeanReference(type = PasswordTrackerPersistence.class)
1925 protected PasswordTrackerPersistence passwordTrackerPersistence;
1926 @BeanReference(type = PermissionPersistence.class)
1927 protected PermissionPersistence permissionPersistence;
1928 @BeanReference(type = PhonePersistence.class)
1929 protected PhonePersistence phonePersistence;
1930 @BeanReference(type = PluginSettingPersistence.class)
1931 protected PluginSettingPersistence pluginSettingPersistence;
1932 @BeanReference(type = PortletPersistence.class)
1933 protected PortletPersistence portletPersistence;
1934 @BeanReference(type = PortletItemPersistence.class)
1935 protected PortletItemPersistence portletItemPersistence;
1936 @BeanReference(type = PortletPreferencesPersistence.class)
1937 protected PortletPreferencesPersistence portletPreferencesPersistence;
1938 @BeanReference(type = RegionPersistence.class)
1939 protected RegionPersistence regionPersistence;
1940 @BeanReference(type = ReleasePersistence.class)
1941 protected ReleasePersistence releasePersistence;
1942 @BeanReference(type = ResourcePersistence.class)
1943 protected ResourcePersistence resourcePersistence;
1944 @BeanReference(type = ResourceActionPersistence.class)
1945 protected ResourceActionPersistence resourceActionPersistence;
1946 @BeanReference(type = ResourceCodePersistence.class)
1947 protected ResourceCodePersistence resourceCodePersistence;
1948 @BeanReference(type = ResourcePermissionPersistence.class)
1949 protected ResourcePermissionPersistence resourcePermissionPersistence;
1950 @BeanReference(type = RolePersistence.class)
1951 protected RolePersistence rolePersistence;
1952 @BeanReference(type = ServiceComponentPersistence.class)
1953 protected ServiceComponentPersistence serviceComponentPersistence;
1954 @BeanReference(type = ShardPersistence.class)
1955 protected ShardPersistence shardPersistence;
1956 @BeanReference(type = SubscriptionPersistence.class)
1957 protected SubscriptionPersistence subscriptionPersistence;
1958 @BeanReference(type = TicketPersistence.class)
1959 protected TicketPersistence ticketPersistence;
1960 @BeanReference(type = TeamPersistence.class)
1961 protected TeamPersistence teamPersistence;
1962 @BeanReference(type = UserPersistence.class)
1963 protected UserPersistence userPersistence;
1964 @BeanReference(type = UserGroupPersistence.class)
1965 protected UserGroupPersistence userGroupPersistence;
1966 @BeanReference(type = UserGroupGroupRolePersistence.class)
1967 protected UserGroupGroupRolePersistence userGroupGroupRolePersistence;
1968 @BeanReference(type = UserGroupRolePersistence.class)
1969 protected UserGroupRolePersistence userGroupRolePersistence;
1970 @BeanReference(type = UserIdMapperPersistence.class)
1971 protected UserIdMapperPersistence userIdMapperPersistence;
1972 @BeanReference(type = UserTrackerPersistence.class)
1973 protected UserTrackerPersistence userTrackerPersistence;
1974 @BeanReference(type = UserTrackerPathPersistence.class)
1975 protected UserTrackerPathPersistence userTrackerPathPersistence;
1976 @BeanReference(type = WebDAVPropsPersistence.class)
1977 protected WebDAVPropsPersistence webDAVPropsPersistence;
1978 @BeanReference(type = WebsitePersistence.class)
1979 protected WebsitePersistence websitePersistence;
1980 @BeanReference(type = WorkflowDefinitionLinkPersistence.class)
1981 protected WorkflowDefinitionLinkPersistence workflowDefinitionLinkPersistence;
1982 @BeanReference(type = WorkflowInstanceLinkPersistence.class)
1983 protected WorkflowInstanceLinkPersistence workflowInstanceLinkPersistence;
1984 private static final String _SQL_SELECT_PORTLETITEM = "SELECT portletItem FROM PortletItem portletItem";
1985 private static final String _SQL_SELECT_PORTLETITEM_WHERE = "SELECT portletItem FROM PortletItem portletItem WHERE ";
1986 private static final String _SQL_COUNT_PORTLETITEM = "SELECT COUNT(portletItem) FROM PortletItem portletItem";
1987 private static final String _SQL_COUNT_PORTLETITEM_WHERE = "SELECT COUNT(portletItem) FROM PortletItem portletItem WHERE ";
1988 private static final String _FINDER_COLUMN_G_C_GROUPID_2 = "portletItem.groupId = ? AND ";
1989 private static final String _FINDER_COLUMN_G_C_CLASSNAMEID_2 = "portletItem.classNameId = ?";
1990 private static final String _FINDER_COLUMN_G_P_C_GROUPID_2 = "portletItem.groupId = ? AND ";
1991 private static final String _FINDER_COLUMN_G_P_C_PORTLETID_1 = "portletItem.portletId IS NULL AND ";
1992 private static final String _FINDER_COLUMN_G_P_C_PORTLETID_2 = "portletItem.portletId = ? AND ";
1993 private static final String _FINDER_COLUMN_G_P_C_PORTLETID_3 = "(portletItem.portletId IS NULL OR portletItem.portletId = ?) AND ";
1994 private static final String _FINDER_COLUMN_G_P_C_CLASSNAMEID_2 = "portletItem.classNameId = ?";
1995 private static final String _FINDER_COLUMN_G_N_P_C_GROUPID_2 = "portletItem.groupId = ? AND ";
1996 private static final String _FINDER_COLUMN_G_N_P_C_NAME_1 = "portletItem.name IS NULL AND ";
1997 private static final String _FINDER_COLUMN_G_N_P_C_NAME_2 = "lower(portletItem.name) = lower(?) AND ";
1998 private static final String _FINDER_COLUMN_G_N_P_C_NAME_3 = "(portletItem.name IS NULL OR lower(portletItem.name) = lower(?)) AND ";
1999 private static final String _FINDER_COLUMN_G_N_P_C_PORTLETID_1 = "portletItem.portletId IS NULL AND ";
2000 private static final String _FINDER_COLUMN_G_N_P_C_PORTLETID_2 = "portletItem.portletId = ? AND ";
2001 private static final String _FINDER_COLUMN_G_N_P_C_PORTLETID_3 = "(portletItem.portletId IS NULL OR portletItem.portletId = ?) AND ";
2002 private static final String _FINDER_COLUMN_G_N_P_C_CLASSNAMEID_2 = "portletItem.classNameId = ?";
2003 private static final String _ORDER_BY_ENTITY_ALIAS = "portletItem.";
2004 private static final String _NO_SUCH_ENTITY_WITH_PRIMARY_KEY = "No PortletItem exists with the primary key ";
2005 private static final String _NO_SUCH_ENTITY_WITH_KEY = "No PortletItem exists with the key {";
2006 private static Log _log = LogFactoryUtil.getLog(PortletItemPersistenceImpl.class);
2007 }