001
014
015 package com.liferay.portal.service.persistence;
016
017 import com.liferay.portal.NoSuchModelException;
018 import com.liferay.portal.NoSuchOrgGroupPermissionException;
019 import com.liferay.portal.kernel.bean.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.model.CacheModel;
038 import com.liferay.portal.model.ModelListener;
039 import com.liferay.portal.model.OrgGroupPermission;
040 import com.liferay.portal.model.impl.OrgGroupPermissionImpl;
041 import com.liferay.portal.model.impl.OrgGroupPermissionModelImpl;
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
062 public class OrgGroupPermissionPersistenceImpl extends BasePersistenceImpl<OrgGroupPermission>
063 implements OrgGroupPermissionPersistence {
064
069 public static final String FINDER_CLASS_NAME_ENTITY = OrgGroupPermissionImpl.class.getName();
070 public static final String FINDER_CLASS_NAME_LIST_WITH_PAGINATION = FINDER_CLASS_NAME_ENTITY +
071 ".List1";
072 public static final String FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION = FINDER_CLASS_NAME_ENTITY +
073 ".List2";
074 public static final FinderPath FINDER_PATH_WITH_PAGINATION_FIND_BY_GROUPID = new FinderPath(OrgGroupPermissionModelImpl.ENTITY_CACHE_ENABLED,
075 OrgGroupPermissionModelImpl.FINDER_CACHE_ENABLED,
076 OrgGroupPermissionImpl.class,
077 FINDER_CLASS_NAME_LIST_WITH_PAGINATION, "findByGroupId",
078 new String[] {
079 Long.class.getName(),
080
081 "java.lang.Integer", "java.lang.Integer",
082 "com.liferay.portal.kernel.util.OrderByComparator"
083 });
084 public static final FinderPath FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_GROUPID =
085 new FinderPath(OrgGroupPermissionModelImpl.ENTITY_CACHE_ENABLED,
086 OrgGroupPermissionModelImpl.FINDER_CACHE_ENABLED,
087 OrgGroupPermissionImpl.class,
088 FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "findByGroupId",
089 new String[] { Long.class.getName() },
090 OrgGroupPermissionModelImpl.GROUPID_COLUMN_BITMASK);
091 public static final FinderPath FINDER_PATH_COUNT_BY_GROUPID = new FinderPath(OrgGroupPermissionModelImpl.ENTITY_CACHE_ENABLED,
092 OrgGroupPermissionModelImpl.FINDER_CACHE_ENABLED, Long.class,
093 FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "countByGroupId",
094 new String[] { Long.class.getName() });
095 public static final FinderPath FINDER_PATH_WITH_PAGINATION_FIND_BY_PERMISSIONID =
096 new FinderPath(OrgGroupPermissionModelImpl.ENTITY_CACHE_ENABLED,
097 OrgGroupPermissionModelImpl.FINDER_CACHE_ENABLED,
098 OrgGroupPermissionImpl.class,
099 FINDER_CLASS_NAME_LIST_WITH_PAGINATION, "findByPermissionId",
100 new String[] {
101 Long.class.getName(),
102
103 "java.lang.Integer", "java.lang.Integer",
104 "com.liferay.portal.kernel.util.OrderByComparator"
105 });
106 public static final FinderPath FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_PERMISSIONID =
107 new FinderPath(OrgGroupPermissionModelImpl.ENTITY_CACHE_ENABLED,
108 OrgGroupPermissionModelImpl.FINDER_CACHE_ENABLED,
109 OrgGroupPermissionImpl.class,
110 FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "findByPermissionId",
111 new String[] { Long.class.getName() },
112 OrgGroupPermissionModelImpl.PERMISSIONID_COLUMN_BITMASK);
113 public static final FinderPath FINDER_PATH_COUNT_BY_PERMISSIONID = new FinderPath(OrgGroupPermissionModelImpl.ENTITY_CACHE_ENABLED,
114 OrgGroupPermissionModelImpl.FINDER_CACHE_ENABLED, Long.class,
115 FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "countByPermissionId",
116 new String[] { Long.class.getName() });
117 public static final FinderPath FINDER_PATH_WITH_PAGINATION_FIND_ALL = new FinderPath(OrgGroupPermissionModelImpl.ENTITY_CACHE_ENABLED,
118 OrgGroupPermissionModelImpl.FINDER_CACHE_ENABLED,
119 OrgGroupPermissionImpl.class,
120 FINDER_CLASS_NAME_LIST_WITH_PAGINATION, "findAll", new String[0]);
121 public static final FinderPath FINDER_PATH_WITHOUT_PAGINATION_FIND_ALL = new FinderPath(OrgGroupPermissionModelImpl.ENTITY_CACHE_ENABLED,
122 OrgGroupPermissionModelImpl.FINDER_CACHE_ENABLED,
123 OrgGroupPermissionImpl.class,
124 FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "findAll", new String[0]);
125 public static final FinderPath FINDER_PATH_COUNT_ALL = new FinderPath(OrgGroupPermissionModelImpl.ENTITY_CACHE_ENABLED,
126 OrgGroupPermissionModelImpl.FINDER_CACHE_ENABLED, Long.class,
127 FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "countAll", new String[0]);
128
129
134 public void cacheResult(OrgGroupPermission orgGroupPermission) {
135 EntityCacheUtil.putResult(OrgGroupPermissionModelImpl.ENTITY_CACHE_ENABLED,
136 OrgGroupPermissionImpl.class, orgGroupPermission.getPrimaryKey(),
137 orgGroupPermission);
138
139 orgGroupPermission.resetOriginalValues();
140 }
141
142
147 public void cacheResult(List<OrgGroupPermission> orgGroupPermissions) {
148 for (OrgGroupPermission orgGroupPermission : orgGroupPermissions) {
149 if (EntityCacheUtil.getResult(
150 OrgGroupPermissionModelImpl.ENTITY_CACHE_ENABLED,
151 OrgGroupPermissionImpl.class,
152 orgGroupPermission.getPrimaryKey()) == null) {
153 cacheResult(orgGroupPermission);
154 }
155 else {
156 orgGroupPermission.resetOriginalValues();
157 }
158 }
159 }
160
161
168 @Override
169 public void clearCache() {
170 if (_HIBERNATE_CACHE_USE_SECOND_LEVEL_CACHE) {
171 CacheRegistryUtil.clear(OrgGroupPermissionImpl.class.getName());
172 }
173
174 EntityCacheUtil.clearCache(OrgGroupPermissionImpl.class.getName());
175
176 FinderCacheUtil.clearCache(FINDER_CLASS_NAME_ENTITY);
177 FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
178 FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
179 }
180
181
188 @Override
189 public void clearCache(OrgGroupPermission orgGroupPermission) {
190 EntityCacheUtil.removeResult(OrgGroupPermissionModelImpl.ENTITY_CACHE_ENABLED,
191 OrgGroupPermissionImpl.class, orgGroupPermission.getPrimaryKey());
192
193 FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
194 FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
195 }
196
197 @Override
198 public void clearCache(List<OrgGroupPermission> orgGroupPermissions) {
199 FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
200 FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
201
202 for (OrgGroupPermission orgGroupPermission : orgGroupPermissions) {
203 EntityCacheUtil.removeResult(OrgGroupPermissionModelImpl.ENTITY_CACHE_ENABLED,
204 OrgGroupPermissionImpl.class, orgGroupPermission.getPrimaryKey());
205 }
206 }
207
208
214 public OrgGroupPermission create(OrgGroupPermissionPK orgGroupPermissionPK) {
215 OrgGroupPermission orgGroupPermission = new OrgGroupPermissionImpl();
216
217 orgGroupPermission.setNew(true);
218 orgGroupPermission.setPrimaryKey(orgGroupPermissionPK);
219
220 return orgGroupPermission;
221 }
222
223
231 public OrgGroupPermission remove(OrgGroupPermissionPK orgGroupPermissionPK)
232 throws NoSuchOrgGroupPermissionException, SystemException {
233 return remove((Serializable)orgGroupPermissionPK);
234 }
235
236
244 @Override
245 public OrgGroupPermission remove(Serializable primaryKey)
246 throws NoSuchOrgGroupPermissionException, SystemException {
247 Session session = null;
248
249 try {
250 session = openSession();
251
252 OrgGroupPermission orgGroupPermission = (OrgGroupPermission)session.get(OrgGroupPermissionImpl.class,
253 primaryKey);
254
255 if (orgGroupPermission == null) {
256 if (_log.isWarnEnabled()) {
257 _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey);
258 }
259
260 throw new NoSuchOrgGroupPermissionException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
261 primaryKey);
262 }
263
264 return remove(orgGroupPermission);
265 }
266 catch (NoSuchOrgGroupPermissionException nsee) {
267 throw nsee;
268 }
269 catch (Exception e) {
270 throw processException(e);
271 }
272 finally {
273 closeSession(session);
274 }
275 }
276
277 @Override
278 protected OrgGroupPermission removeImpl(
279 OrgGroupPermission orgGroupPermission) throws SystemException {
280 orgGroupPermission = toUnwrappedModel(orgGroupPermission);
281
282 Session session = null;
283
284 try {
285 session = openSession();
286
287 BatchSessionUtil.delete(session, orgGroupPermission);
288 }
289 catch (Exception e) {
290 throw processException(e);
291 }
292 finally {
293 closeSession(session);
294 }
295
296 clearCache(orgGroupPermission);
297
298 return orgGroupPermission;
299 }
300
301 @Override
302 public OrgGroupPermission updateImpl(
303 com.liferay.portal.model.OrgGroupPermission orgGroupPermission,
304 boolean merge) throws SystemException {
305 orgGroupPermission = toUnwrappedModel(orgGroupPermission);
306
307 boolean isNew = orgGroupPermission.isNew();
308
309 OrgGroupPermissionModelImpl orgGroupPermissionModelImpl = (OrgGroupPermissionModelImpl)orgGroupPermission;
310
311 Session session = null;
312
313 try {
314 session = openSession();
315
316 BatchSessionUtil.update(session, orgGroupPermission, merge);
317
318 orgGroupPermission.setNew(false);
319 }
320 catch (Exception e) {
321 throw processException(e);
322 }
323 finally {
324 closeSession(session);
325 }
326
327 FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
328
329 if (isNew || !OrgGroupPermissionModelImpl.COLUMN_BITMASK_ENABLED) {
330 FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
331 }
332 else {
333 if ((orgGroupPermissionModelImpl.getColumnBitmask() &
334 FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_GROUPID.getColumnBitmask()) != 0) {
335 Object[] args = new Object[] {
336 Long.valueOf(orgGroupPermissionModelImpl.getOriginalGroupId())
337 };
338
339 FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_GROUPID, args);
340 FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_GROUPID,
341 args);
342
343 args = new Object[] {
344 Long.valueOf(orgGroupPermissionModelImpl.getGroupId())
345 };
346
347 FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_GROUPID, args);
348 FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_GROUPID,
349 args);
350 }
351
352 if ((orgGroupPermissionModelImpl.getColumnBitmask() &
353 FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_PERMISSIONID.getColumnBitmask()) != 0) {
354 Object[] args = new Object[] {
355 Long.valueOf(orgGroupPermissionModelImpl.getOriginalPermissionId())
356 };
357
358 FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_PERMISSIONID,
359 args);
360 FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_PERMISSIONID,
361 args);
362
363 args = new Object[] {
364 Long.valueOf(orgGroupPermissionModelImpl.getPermissionId())
365 };
366
367 FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_PERMISSIONID,
368 args);
369 FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_PERMISSIONID,
370 args);
371 }
372 }
373
374 EntityCacheUtil.putResult(OrgGroupPermissionModelImpl.ENTITY_CACHE_ENABLED,
375 OrgGroupPermissionImpl.class, orgGroupPermission.getPrimaryKey(),
376 orgGroupPermission);
377
378 return orgGroupPermission;
379 }
380
381 protected OrgGroupPermission toUnwrappedModel(
382 OrgGroupPermission orgGroupPermission) {
383 if (orgGroupPermission instanceof OrgGroupPermissionImpl) {
384 return orgGroupPermission;
385 }
386
387 OrgGroupPermissionImpl orgGroupPermissionImpl = new OrgGroupPermissionImpl();
388
389 orgGroupPermissionImpl.setNew(orgGroupPermission.isNew());
390 orgGroupPermissionImpl.setPrimaryKey(orgGroupPermission.getPrimaryKey());
391
392 orgGroupPermissionImpl.setOrganizationId(orgGroupPermission.getOrganizationId());
393 orgGroupPermissionImpl.setGroupId(orgGroupPermission.getGroupId());
394 orgGroupPermissionImpl.setPermissionId(orgGroupPermission.getPermissionId());
395
396 return orgGroupPermissionImpl;
397 }
398
399
407 @Override
408 public OrgGroupPermission findByPrimaryKey(Serializable primaryKey)
409 throws NoSuchModelException, SystemException {
410 return findByPrimaryKey((OrgGroupPermissionPK)primaryKey);
411 }
412
413
421 public OrgGroupPermission findByPrimaryKey(
422 OrgGroupPermissionPK orgGroupPermissionPK)
423 throws NoSuchOrgGroupPermissionException, SystemException {
424 OrgGroupPermission orgGroupPermission = fetchByPrimaryKey(orgGroupPermissionPK);
425
426 if (orgGroupPermission == null) {
427 if (_log.isWarnEnabled()) {
428 _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
429 orgGroupPermissionPK);
430 }
431
432 throw new NoSuchOrgGroupPermissionException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
433 orgGroupPermissionPK);
434 }
435
436 return orgGroupPermission;
437 }
438
439
446 @Override
447 public OrgGroupPermission fetchByPrimaryKey(Serializable primaryKey)
448 throws SystemException {
449 return fetchByPrimaryKey((OrgGroupPermissionPK)primaryKey);
450 }
451
452
459 public OrgGroupPermission fetchByPrimaryKey(
460 OrgGroupPermissionPK orgGroupPermissionPK) throws SystemException {
461 OrgGroupPermission orgGroupPermission = (OrgGroupPermission)EntityCacheUtil.getResult(OrgGroupPermissionModelImpl.ENTITY_CACHE_ENABLED,
462 OrgGroupPermissionImpl.class, orgGroupPermissionPK);
463
464 if (orgGroupPermission == _nullOrgGroupPermission) {
465 return null;
466 }
467
468 if (orgGroupPermission == null) {
469 Session session = null;
470
471 boolean hasException = false;
472
473 try {
474 session = openSession();
475
476 orgGroupPermission = (OrgGroupPermission)session.get(OrgGroupPermissionImpl.class,
477 orgGroupPermissionPK);
478 }
479 catch (Exception e) {
480 hasException = true;
481
482 throw processException(e);
483 }
484 finally {
485 if (orgGroupPermission != null) {
486 cacheResult(orgGroupPermission);
487 }
488 else if (!hasException) {
489 EntityCacheUtil.putResult(OrgGroupPermissionModelImpl.ENTITY_CACHE_ENABLED,
490 OrgGroupPermissionImpl.class, orgGroupPermissionPK,
491 _nullOrgGroupPermission);
492 }
493
494 closeSession(session);
495 }
496 }
497
498 return orgGroupPermission;
499 }
500
501
508 public List<OrgGroupPermission> findByGroupId(long groupId)
509 throws SystemException {
510 return findByGroupId(groupId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
511 }
512
513
526 public List<OrgGroupPermission> findByGroupId(long groupId, int start,
527 int end) throws SystemException {
528 return findByGroupId(groupId, start, end, null);
529 }
530
531
545 public List<OrgGroupPermission> findByGroupId(long groupId, int start,
546 int end, OrderByComparator orderByComparator) throws SystemException {
547 FinderPath finderPath = null;
548 Object[] finderArgs = null;
549
550 if ((start == QueryUtil.ALL_POS) && (end == QueryUtil.ALL_POS) &&
551 (orderByComparator == null)) {
552 finderPath = FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_GROUPID;
553 finderArgs = new Object[] { groupId };
554 }
555 else {
556 finderPath = FINDER_PATH_WITH_PAGINATION_FIND_BY_GROUPID;
557 finderArgs = new Object[] { groupId, start, end, orderByComparator };
558 }
559
560 List<OrgGroupPermission> list = (List<OrgGroupPermission>)FinderCacheUtil.getResult(finderPath,
561 finderArgs, this);
562
563 if ((list != null) && !list.isEmpty()) {
564 for (OrgGroupPermission orgGroupPermission : list) {
565 if ((groupId != orgGroupPermission.getGroupId())) {
566 list = null;
567
568 break;
569 }
570 }
571 }
572
573 if (list == null) {
574 StringBundler query = null;
575
576 if (orderByComparator != null) {
577 query = new StringBundler(3 +
578 (orderByComparator.getOrderByFields().length * 3));
579 }
580 else {
581 query = new StringBundler(2);
582 }
583
584 query.append(_SQL_SELECT_ORGGROUPPERMISSION_WHERE);
585
586 query.append(_FINDER_COLUMN_GROUPID_GROUPID_2);
587
588 if (orderByComparator != null) {
589 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
590 orderByComparator);
591 }
592
593 String sql = query.toString();
594
595 Session session = null;
596
597 try {
598 session = openSession();
599
600 Query q = session.createQuery(sql);
601
602 QueryPos qPos = QueryPos.getInstance(q);
603
604 qPos.add(groupId);
605
606 list = (List<OrgGroupPermission>)QueryUtil.list(q,
607 getDialect(), start, end);
608 }
609 catch (Exception e) {
610 throw processException(e);
611 }
612 finally {
613 if (list == null) {
614 FinderCacheUtil.removeResult(finderPath, finderArgs);
615 }
616 else {
617 cacheResult(list);
618
619 FinderCacheUtil.putResult(finderPath, finderArgs, list);
620 }
621
622 closeSession(session);
623 }
624 }
625
626 return list;
627 }
628
629
642 public OrgGroupPermission findByGroupId_First(long groupId,
643 OrderByComparator orderByComparator)
644 throws NoSuchOrgGroupPermissionException, SystemException {
645 List<OrgGroupPermission> list = findByGroupId(groupId, 0, 1,
646 orderByComparator);
647
648 if (list.isEmpty()) {
649 StringBundler msg = new StringBundler(4);
650
651 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
652
653 msg.append("groupId=");
654 msg.append(groupId);
655
656 msg.append(StringPool.CLOSE_CURLY_BRACE);
657
658 throw new NoSuchOrgGroupPermissionException(msg.toString());
659 }
660 else {
661 return list.get(0);
662 }
663 }
664
665
678 public OrgGroupPermission findByGroupId_Last(long groupId,
679 OrderByComparator orderByComparator)
680 throws NoSuchOrgGroupPermissionException, SystemException {
681 int count = countByGroupId(groupId);
682
683 List<OrgGroupPermission> list = findByGroupId(groupId, count - 1,
684 count, orderByComparator);
685
686 if (list.isEmpty()) {
687 StringBundler msg = new StringBundler(4);
688
689 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
690
691 msg.append("groupId=");
692 msg.append(groupId);
693
694 msg.append(StringPool.CLOSE_CURLY_BRACE);
695
696 throw new NoSuchOrgGroupPermissionException(msg.toString());
697 }
698 else {
699 return list.get(0);
700 }
701 }
702
703
717 public OrgGroupPermission[] findByGroupId_PrevAndNext(
718 OrgGroupPermissionPK orgGroupPermissionPK, long groupId,
719 OrderByComparator orderByComparator)
720 throws NoSuchOrgGroupPermissionException, SystemException {
721 OrgGroupPermission orgGroupPermission = findByPrimaryKey(orgGroupPermissionPK);
722
723 Session session = null;
724
725 try {
726 session = openSession();
727
728 OrgGroupPermission[] array = new OrgGroupPermissionImpl[3];
729
730 array[0] = getByGroupId_PrevAndNext(session, orgGroupPermission,
731 groupId, orderByComparator, true);
732
733 array[1] = orgGroupPermission;
734
735 array[2] = getByGroupId_PrevAndNext(session, orgGroupPermission,
736 groupId, orderByComparator, false);
737
738 return array;
739 }
740 catch (Exception e) {
741 throw processException(e);
742 }
743 finally {
744 closeSession(session);
745 }
746 }
747
748 protected OrgGroupPermission getByGroupId_PrevAndNext(Session session,
749 OrgGroupPermission orgGroupPermission, long groupId,
750 OrderByComparator orderByComparator, boolean previous) {
751 StringBundler query = null;
752
753 if (orderByComparator != null) {
754 query = new StringBundler(6 +
755 (orderByComparator.getOrderByFields().length * 6));
756 }
757 else {
758 query = new StringBundler(3);
759 }
760
761 query.append(_SQL_SELECT_ORGGROUPPERMISSION_WHERE);
762
763 query.append(_FINDER_COLUMN_GROUPID_GROUPID_2);
764
765 if (orderByComparator != null) {
766 String[] orderByConditionFields = orderByComparator.getOrderByConditionFields();
767
768 if (orderByConditionFields.length > 0) {
769 query.append(WHERE_AND);
770 }
771
772 for (int i = 0; i < orderByConditionFields.length; i++) {
773 query.append(_ORDER_BY_ENTITY_ALIAS);
774 query.append(orderByConditionFields[i]);
775
776 if ((i + 1) < orderByConditionFields.length) {
777 if (orderByComparator.isAscending() ^ previous) {
778 query.append(WHERE_GREATER_THAN_HAS_NEXT);
779 }
780 else {
781 query.append(WHERE_LESSER_THAN_HAS_NEXT);
782 }
783 }
784 else {
785 if (orderByComparator.isAscending() ^ previous) {
786 query.append(WHERE_GREATER_THAN);
787 }
788 else {
789 query.append(WHERE_LESSER_THAN);
790 }
791 }
792 }
793
794 query.append(ORDER_BY_CLAUSE);
795
796 String[] orderByFields = orderByComparator.getOrderByFields();
797
798 for (int i = 0; i < orderByFields.length; i++) {
799 query.append(_ORDER_BY_ENTITY_ALIAS);
800 query.append(orderByFields[i]);
801
802 if ((i + 1) < orderByFields.length) {
803 if (orderByComparator.isAscending() ^ previous) {
804 query.append(ORDER_BY_ASC_HAS_NEXT);
805 }
806 else {
807 query.append(ORDER_BY_DESC_HAS_NEXT);
808 }
809 }
810 else {
811 if (orderByComparator.isAscending() ^ previous) {
812 query.append(ORDER_BY_ASC);
813 }
814 else {
815 query.append(ORDER_BY_DESC);
816 }
817 }
818 }
819 }
820
821 String sql = query.toString();
822
823 Query q = session.createQuery(sql);
824
825 q.setFirstResult(0);
826 q.setMaxResults(2);
827
828 QueryPos qPos = QueryPos.getInstance(q);
829
830 qPos.add(groupId);
831
832 if (orderByComparator != null) {
833 Object[] values = orderByComparator.getOrderByConditionValues(orgGroupPermission);
834
835 for (Object value : values) {
836 qPos.add(value);
837 }
838 }
839
840 List<OrgGroupPermission> list = q.list();
841
842 if (list.size() == 2) {
843 return list.get(1);
844 }
845 else {
846 return null;
847 }
848 }
849
850
857 public List<OrgGroupPermission> findByPermissionId(long permissionId)
858 throws SystemException {
859 return findByPermissionId(permissionId, QueryUtil.ALL_POS,
860 QueryUtil.ALL_POS, null);
861 }
862
863
876 public List<OrgGroupPermission> findByPermissionId(long permissionId,
877 int start, int end) throws SystemException {
878 return findByPermissionId(permissionId, start, end, null);
879 }
880
881
895 public List<OrgGroupPermission> findByPermissionId(long permissionId,
896 int start, int end, OrderByComparator orderByComparator)
897 throws SystemException {
898 FinderPath finderPath = null;
899 Object[] finderArgs = null;
900
901 if ((start == QueryUtil.ALL_POS) && (end == QueryUtil.ALL_POS) &&
902 (orderByComparator == null)) {
903 finderPath = FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_PERMISSIONID;
904 finderArgs = new Object[] { permissionId };
905 }
906 else {
907 finderPath = FINDER_PATH_WITH_PAGINATION_FIND_BY_PERMISSIONID;
908 finderArgs = new Object[] {
909 permissionId,
910
911 start, end, orderByComparator
912 };
913 }
914
915 List<OrgGroupPermission> list = (List<OrgGroupPermission>)FinderCacheUtil.getResult(finderPath,
916 finderArgs, this);
917
918 if ((list != null) && !list.isEmpty()) {
919 for (OrgGroupPermission orgGroupPermission : list) {
920 if ((permissionId != orgGroupPermission.getPermissionId())) {
921 list = null;
922
923 break;
924 }
925 }
926 }
927
928 if (list == null) {
929 StringBundler query = null;
930
931 if (orderByComparator != null) {
932 query = new StringBundler(3 +
933 (orderByComparator.getOrderByFields().length * 3));
934 }
935 else {
936 query = new StringBundler(2);
937 }
938
939 query.append(_SQL_SELECT_ORGGROUPPERMISSION_WHERE);
940
941 query.append(_FINDER_COLUMN_PERMISSIONID_PERMISSIONID_2);
942
943 if (orderByComparator != null) {
944 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
945 orderByComparator);
946 }
947
948 String sql = query.toString();
949
950 Session session = null;
951
952 try {
953 session = openSession();
954
955 Query q = session.createQuery(sql);
956
957 QueryPos qPos = QueryPos.getInstance(q);
958
959 qPos.add(permissionId);
960
961 list = (List<OrgGroupPermission>)QueryUtil.list(q,
962 getDialect(), start, end);
963 }
964 catch (Exception e) {
965 throw processException(e);
966 }
967 finally {
968 if (list == null) {
969 FinderCacheUtil.removeResult(finderPath, finderArgs);
970 }
971 else {
972 cacheResult(list);
973
974 FinderCacheUtil.putResult(finderPath, finderArgs, list);
975 }
976
977 closeSession(session);
978 }
979 }
980
981 return list;
982 }
983
984
997 public OrgGroupPermission findByPermissionId_First(long permissionId,
998 OrderByComparator orderByComparator)
999 throws NoSuchOrgGroupPermissionException, SystemException {
1000 List<OrgGroupPermission> list = findByPermissionId(permissionId, 0, 1,
1001 orderByComparator);
1002
1003 if (list.isEmpty()) {
1004 StringBundler msg = new StringBundler(4);
1005
1006 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
1007
1008 msg.append("permissionId=");
1009 msg.append(permissionId);
1010
1011 msg.append(StringPool.CLOSE_CURLY_BRACE);
1012
1013 throw new NoSuchOrgGroupPermissionException(msg.toString());
1014 }
1015 else {
1016 return list.get(0);
1017 }
1018 }
1019
1020
1033 public OrgGroupPermission findByPermissionId_Last(long permissionId,
1034 OrderByComparator orderByComparator)
1035 throws NoSuchOrgGroupPermissionException, SystemException {
1036 int count = countByPermissionId(permissionId);
1037
1038 List<OrgGroupPermission> list = findByPermissionId(permissionId,
1039 count - 1, count, orderByComparator);
1040
1041 if (list.isEmpty()) {
1042 StringBundler msg = new StringBundler(4);
1043
1044 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
1045
1046 msg.append("permissionId=");
1047 msg.append(permissionId);
1048
1049 msg.append(StringPool.CLOSE_CURLY_BRACE);
1050
1051 throw new NoSuchOrgGroupPermissionException(msg.toString());
1052 }
1053 else {
1054 return list.get(0);
1055 }
1056 }
1057
1058
1072 public OrgGroupPermission[] findByPermissionId_PrevAndNext(
1073 OrgGroupPermissionPK orgGroupPermissionPK, long permissionId,
1074 OrderByComparator orderByComparator)
1075 throws NoSuchOrgGroupPermissionException, SystemException {
1076 OrgGroupPermission orgGroupPermission = findByPrimaryKey(orgGroupPermissionPK);
1077
1078 Session session = null;
1079
1080 try {
1081 session = openSession();
1082
1083 OrgGroupPermission[] array = new OrgGroupPermissionImpl[3];
1084
1085 array[0] = getByPermissionId_PrevAndNext(session,
1086 orgGroupPermission, permissionId, orderByComparator, true);
1087
1088 array[1] = orgGroupPermission;
1089
1090 array[2] = getByPermissionId_PrevAndNext(session,
1091 orgGroupPermission, permissionId, orderByComparator, false);
1092
1093 return array;
1094 }
1095 catch (Exception e) {
1096 throw processException(e);
1097 }
1098 finally {
1099 closeSession(session);
1100 }
1101 }
1102
1103 protected OrgGroupPermission getByPermissionId_PrevAndNext(
1104 Session session, OrgGroupPermission orgGroupPermission,
1105 long permissionId, OrderByComparator orderByComparator, boolean previous) {
1106 StringBundler query = null;
1107
1108 if (orderByComparator != null) {
1109 query = new StringBundler(6 +
1110 (orderByComparator.getOrderByFields().length * 6));
1111 }
1112 else {
1113 query = new StringBundler(3);
1114 }
1115
1116 query.append(_SQL_SELECT_ORGGROUPPERMISSION_WHERE);
1117
1118 query.append(_FINDER_COLUMN_PERMISSIONID_PERMISSIONID_2);
1119
1120 if (orderByComparator != null) {
1121 String[] orderByConditionFields = orderByComparator.getOrderByConditionFields();
1122
1123 if (orderByConditionFields.length > 0) {
1124 query.append(WHERE_AND);
1125 }
1126
1127 for (int i = 0; i < orderByConditionFields.length; i++) {
1128 query.append(_ORDER_BY_ENTITY_ALIAS);
1129 query.append(orderByConditionFields[i]);
1130
1131 if ((i + 1) < orderByConditionFields.length) {
1132 if (orderByComparator.isAscending() ^ previous) {
1133 query.append(WHERE_GREATER_THAN_HAS_NEXT);
1134 }
1135 else {
1136 query.append(WHERE_LESSER_THAN_HAS_NEXT);
1137 }
1138 }
1139 else {
1140 if (orderByComparator.isAscending() ^ previous) {
1141 query.append(WHERE_GREATER_THAN);
1142 }
1143 else {
1144 query.append(WHERE_LESSER_THAN);
1145 }
1146 }
1147 }
1148
1149 query.append(ORDER_BY_CLAUSE);
1150
1151 String[] orderByFields = orderByComparator.getOrderByFields();
1152
1153 for (int i = 0; i < orderByFields.length; i++) {
1154 query.append(_ORDER_BY_ENTITY_ALIAS);
1155 query.append(orderByFields[i]);
1156
1157 if ((i + 1) < orderByFields.length) {
1158 if (orderByComparator.isAscending() ^ previous) {
1159 query.append(ORDER_BY_ASC_HAS_NEXT);
1160 }
1161 else {
1162 query.append(ORDER_BY_DESC_HAS_NEXT);
1163 }
1164 }
1165 else {
1166 if (orderByComparator.isAscending() ^ previous) {
1167 query.append(ORDER_BY_ASC);
1168 }
1169 else {
1170 query.append(ORDER_BY_DESC);
1171 }
1172 }
1173 }
1174 }
1175
1176 String sql = query.toString();
1177
1178 Query q = session.createQuery(sql);
1179
1180 q.setFirstResult(0);
1181 q.setMaxResults(2);
1182
1183 QueryPos qPos = QueryPos.getInstance(q);
1184
1185 qPos.add(permissionId);
1186
1187 if (orderByComparator != null) {
1188 Object[] values = orderByComparator.getOrderByConditionValues(orgGroupPermission);
1189
1190 for (Object value : values) {
1191 qPos.add(value);
1192 }
1193 }
1194
1195 List<OrgGroupPermission> list = q.list();
1196
1197 if (list.size() == 2) {
1198 return list.get(1);
1199 }
1200 else {
1201 return null;
1202 }
1203 }
1204
1205
1211 public List<OrgGroupPermission> findAll() throws SystemException {
1212 return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
1213 }
1214
1215
1227 public List<OrgGroupPermission> findAll(int start, int end)
1228 throws SystemException {
1229 return findAll(start, end, null);
1230 }
1231
1232
1245 public List<OrgGroupPermission> findAll(int start, int end,
1246 OrderByComparator orderByComparator) throws SystemException {
1247 FinderPath finderPath = null;
1248 Object[] finderArgs = new Object[] { start, end, orderByComparator };
1249
1250 if ((start == QueryUtil.ALL_POS) && (end == QueryUtil.ALL_POS) &&
1251 (orderByComparator == null)) {
1252 finderPath = FINDER_PATH_WITHOUT_PAGINATION_FIND_ALL;
1253 finderArgs = FINDER_ARGS_EMPTY;
1254 }
1255 else {
1256 finderPath = FINDER_PATH_WITH_PAGINATION_FIND_ALL;
1257 finderArgs = new Object[] { start, end, orderByComparator };
1258 }
1259
1260 List<OrgGroupPermission> list = (List<OrgGroupPermission>)FinderCacheUtil.getResult(finderPath,
1261 finderArgs, this);
1262
1263 if (list == null) {
1264 StringBundler query = null;
1265 String sql = null;
1266
1267 if (orderByComparator != null) {
1268 query = new StringBundler(2 +
1269 (orderByComparator.getOrderByFields().length * 3));
1270
1271 query.append(_SQL_SELECT_ORGGROUPPERMISSION);
1272
1273 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
1274 orderByComparator);
1275
1276 sql = query.toString();
1277 }
1278 else {
1279 sql = _SQL_SELECT_ORGGROUPPERMISSION;
1280 }
1281
1282 Session session = null;
1283
1284 try {
1285 session = openSession();
1286
1287 Query q = session.createQuery(sql);
1288
1289 if (orderByComparator == null) {
1290 list = (List<OrgGroupPermission>)QueryUtil.list(q,
1291 getDialect(), start, end, false);
1292
1293 Collections.sort(list);
1294 }
1295 else {
1296 list = (List<OrgGroupPermission>)QueryUtil.list(q,
1297 getDialect(), start, end);
1298 }
1299 }
1300 catch (Exception e) {
1301 throw processException(e);
1302 }
1303 finally {
1304 if (list == null) {
1305 FinderCacheUtil.removeResult(finderPath, finderArgs);
1306 }
1307 else {
1308 cacheResult(list);
1309
1310 FinderCacheUtil.putResult(finderPath, finderArgs, list);
1311 }
1312
1313 closeSession(session);
1314 }
1315 }
1316
1317 return list;
1318 }
1319
1320
1326 public void removeByGroupId(long groupId) throws SystemException {
1327 for (OrgGroupPermission orgGroupPermission : findByGroupId(groupId)) {
1328 remove(orgGroupPermission);
1329 }
1330 }
1331
1332
1338 public void removeByPermissionId(long permissionId)
1339 throws SystemException {
1340 for (OrgGroupPermission orgGroupPermission : findByPermissionId(
1341 permissionId)) {
1342 remove(orgGroupPermission);
1343 }
1344 }
1345
1346
1351 public void removeAll() throws SystemException {
1352 for (OrgGroupPermission orgGroupPermission : findAll()) {
1353 remove(orgGroupPermission);
1354 }
1355 }
1356
1357
1364 public int countByGroupId(long groupId) throws SystemException {
1365 Object[] finderArgs = new Object[] { groupId };
1366
1367 Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_GROUPID,
1368 finderArgs, this);
1369
1370 if (count == null) {
1371 StringBundler query = new StringBundler(2);
1372
1373 query.append(_SQL_COUNT_ORGGROUPPERMISSION_WHERE);
1374
1375 query.append(_FINDER_COLUMN_GROUPID_GROUPID_2);
1376
1377 String sql = query.toString();
1378
1379 Session session = null;
1380
1381 try {
1382 session = openSession();
1383
1384 Query q = session.createQuery(sql);
1385
1386 QueryPos qPos = QueryPos.getInstance(q);
1387
1388 qPos.add(groupId);
1389
1390 count = (Long)q.uniqueResult();
1391 }
1392 catch (Exception e) {
1393 throw processException(e);
1394 }
1395 finally {
1396 if (count == null) {
1397 count = Long.valueOf(0);
1398 }
1399
1400 FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_GROUPID,
1401 finderArgs, count);
1402
1403 closeSession(session);
1404 }
1405 }
1406
1407 return count.intValue();
1408 }
1409
1410
1417 public int countByPermissionId(long permissionId) throws SystemException {
1418 Object[] finderArgs = new Object[] { permissionId };
1419
1420 Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_PERMISSIONID,
1421 finderArgs, this);
1422
1423 if (count == null) {
1424 StringBundler query = new StringBundler(2);
1425
1426 query.append(_SQL_COUNT_ORGGROUPPERMISSION_WHERE);
1427
1428 query.append(_FINDER_COLUMN_PERMISSIONID_PERMISSIONID_2);
1429
1430 String sql = query.toString();
1431
1432 Session session = null;
1433
1434 try {
1435 session = openSession();
1436
1437 Query q = session.createQuery(sql);
1438
1439 QueryPos qPos = QueryPos.getInstance(q);
1440
1441 qPos.add(permissionId);
1442
1443 count = (Long)q.uniqueResult();
1444 }
1445 catch (Exception e) {
1446 throw processException(e);
1447 }
1448 finally {
1449 if (count == null) {
1450 count = Long.valueOf(0);
1451 }
1452
1453 FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_PERMISSIONID,
1454 finderArgs, count);
1455
1456 closeSession(session);
1457 }
1458 }
1459
1460 return count.intValue();
1461 }
1462
1463
1469 public int countAll() throws SystemException {
1470 Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_ALL,
1471 FINDER_ARGS_EMPTY, this);
1472
1473 if (count == null) {
1474 Session session = null;
1475
1476 try {
1477 session = openSession();
1478
1479 Query q = session.createQuery(_SQL_COUNT_ORGGROUPPERMISSION);
1480
1481 count = (Long)q.uniqueResult();
1482 }
1483 catch (Exception e) {
1484 throw processException(e);
1485 }
1486 finally {
1487 if (count == null) {
1488 count = Long.valueOf(0);
1489 }
1490
1491 FinderCacheUtil.putResult(FINDER_PATH_COUNT_ALL,
1492 FINDER_ARGS_EMPTY, count);
1493
1494 closeSession(session);
1495 }
1496 }
1497
1498 return count.intValue();
1499 }
1500
1501
1504 public void afterPropertiesSet() {
1505 String[] listenerClassNames = StringUtil.split(GetterUtil.getString(
1506 com.liferay.portal.util.PropsUtil.get(
1507 "value.object.listener.com.liferay.portal.model.OrgGroupPermission")));
1508
1509 if (listenerClassNames.length > 0) {
1510 try {
1511 List<ModelListener<OrgGroupPermission>> listenersList = new ArrayList<ModelListener<OrgGroupPermission>>();
1512
1513 for (String listenerClassName : listenerClassNames) {
1514 listenersList.add((ModelListener<OrgGroupPermission>)InstanceFactory.newInstance(
1515 listenerClassName));
1516 }
1517
1518 listeners = listenersList.toArray(new ModelListener[listenersList.size()]);
1519 }
1520 catch (Exception e) {
1521 _log.error(e);
1522 }
1523 }
1524 }
1525
1526 public void destroy() {
1527 EntityCacheUtil.removeCache(OrgGroupPermissionImpl.class.getName());
1528 FinderCacheUtil.removeCache(FINDER_CLASS_NAME_ENTITY);
1529 FinderCacheUtil.removeCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
1530 }
1531
1532 @BeanReference(type = AccountPersistence.class)
1533 protected AccountPersistence accountPersistence;
1534 @BeanReference(type = AddressPersistence.class)
1535 protected AddressPersistence addressPersistence;
1536 @BeanReference(type = BrowserTrackerPersistence.class)
1537 protected BrowserTrackerPersistence browserTrackerPersistence;
1538 @BeanReference(type = ClassNamePersistence.class)
1539 protected ClassNamePersistence classNamePersistence;
1540 @BeanReference(type = ClusterGroupPersistence.class)
1541 protected ClusterGroupPersistence clusterGroupPersistence;
1542 @BeanReference(type = CompanyPersistence.class)
1543 protected CompanyPersistence companyPersistence;
1544 @BeanReference(type = ContactPersistence.class)
1545 protected ContactPersistence contactPersistence;
1546 @BeanReference(type = CountryPersistence.class)
1547 protected CountryPersistence countryPersistence;
1548 @BeanReference(type = EmailAddressPersistence.class)
1549 protected EmailAddressPersistence emailAddressPersistence;
1550 @BeanReference(type = GroupPersistence.class)
1551 protected GroupPersistence groupPersistence;
1552 @BeanReference(type = ImagePersistence.class)
1553 protected ImagePersistence imagePersistence;
1554 @BeanReference(type = LayoutPersistence.class)
1555 protected LayoutPersistence layoutPersistence;
1556 @BeanReference(type = LayoutBranchPersistence.class)
1557 protected LayoutBranchPersistence layoutBranchPersistence;
1558 @BeanReference(type = LayoutPrototypePersistence.class)
1559 protected LayoutPrototypePersistence layoutPrototypePersistence;
1560 @BeanReference(type = LayoutRevisionPersistence.class)
1561 protected LayoutRevisionPersistence layoutRevisionPersistence;
1562 @BeanReference(type = LayoutSetPersistence.class)
1563 protected LayoutSetPersistence layoutSetPersistence;
1564 @BeanReference(type = LayoutSetBranchPersistence.class)
1565 protected LayoutSetBranchPersistence layoutSetBranchPersistence;
1566 @BeanReference(type = LayoutSetPrototypePersistence.class)
1567 protected LayoutSetPrototypePersistence layoutSetPrototypePersistence;
1568 @BeanReference(type = ListTypePersistence.class)
1569 protected ListTypePersistence listTypePersistence;
1570 @BeanReference(type = LockPersistence.class)
1571 protected LockPersistence lockPersistence;
1572 @BeanReference(type = MembershipRequestPersistence.class)
1573 protected MembershipRequestPersistence membershipRequestPersistence;
1574 @BeanReference(type = OrganizationPersistence.class)
1575 protected OrganizationPersistence organizationPersistence;
1576 @BeanReference(type = OrgGroupPermissionPersistence.class)
1577 protected OrgGroupPermissionPersistence orgGroupPermissionPersistence;
1578 @BeanReference(type = OrgGroupRolePersistence.class)
1579 protected OrgGroupRolePersistence orgGroupRolePersistence;
1580 @BeanReference(type = OrgLaborPersistence.class)
1581 protected OrgLaborPersistence orgLaborPersistence;
1582 @BeanReference(type = PasswordPolicyPersistence.class)
1583 protected PasswordPolicyPersistence passwordPolicyPersistence;
1584 @BeanReference(type = PasswordPolicyRelPersistence.class)
1585 protected PasswordPolicyRelPersistence passwordPolicyRelPersistence;
1586 @BeanReference(type = PasswordTrackerPersistence.class)
1587 protected PasswordTrackerPersistence passwordTrackerPersistence;
1588 @BeanReference(type = PermissionPersistence.class)
1589 protected PermissionPersistence permissionPersistence;
1590 @BeanReference(type = PhonePersistence.class)
1591 protected PhonePersistence phonePersistence;
1592 @BeanReference(type = PluginSettingPersistence.class)
1593 protected PluginSettingPersistence pluginSettingPersistence;
1594 @BeanReference(type = PortalPreferencesPersistence.class)
1595 protected PortalPreferencesPersistence portalPreferencesPersistence;
1596 @BeanReference(type = PortletPersistence.class)
1597 protected PortletPersistence portletPersistence;
1598 @BeanReference(type = PortletItemPersistence.class)
1599 protected PortletItemPersistence portletItemPersistence;
1600 @BeanReference(type = PortletPreferencesPersistence.class)
1601 protected PortletPreferencesPersistence portletPreferencesPersistence;
1602 @BeanReference(type = RegionPersistence.class)
1603 protected RegionPersistence regionPersistence;
1604 @BeanReference(type = ReleasePersistence.class)
1605 protected ReleasePersistence releasePersistence;
1606 @BeanReference(type = RepositoryPersistence.class)
1607 protected RepositoryPersistence repositoryPersistence;
1608 @BeanReference(type = RepositoryEntryPersistence.class)
1609 protected RepositoryEntryPersistence repositoryEntryPersistence;
1610 @BeanReference(type = ResourcePersistence.class)
1611 protected ResourcePersistence resourcePersistence;
1612 @BeanReference(type = ResourceActionPersistence.class)
1613 protected ResourceActionPersistence resourceActionPersistence;
1614 @BeanReference(type = ResourceBlockPersistence.class)
1615 protected ResourceBlockPersistence resourceBlockPersistence;
1616 @BeanReference(type = ResourceBlockPermissionPersistence.class)
1617 protected ResourceBlockPermissionPersistence resourceBlockPermissionPersistence;
1618 @BeanReference(type = ResourceCodePersistence.class)
1619 protected ResourceCodePersistence resourceCodePersistence;
1620 @BeanReference(type = ResourcePermissionPersistence.class)
1621 protected ResourcePermissionPersistence resourcePermissionPersistence;
1622 @BeanReference(type = ResourceTypePermissionPersistence.class)
1623 protected ResourceTypePermissionPersistence resourceTypePermissionPersistence;
1624 @BeanReference(type = RolePersistence.class)
1625 protected RolePersistence rolePersistence;
1626 @BeanReference(type = ServiceComponentPersistence.class)
1627 protected ServiceComponentPersistence serviceComponentPersistence;
1628 @BeanReference(type = ShardPersistence.class)
1629 protected ShardPersistence shardPersistence;
1630 @BeanReference(type = SubscriptionPersistence.class)
1631 protected SubscriptionPersistence subscriptionPersistence;
1632 @BeanReference(type = TeamPersistence.class)
1633 protected TeamPersistence teamPersistence;
1634 @BeanReference(type = TicketPersistence.class)
1635 protected TicketPersistence ticketPersistence;
1636 @BeanReference(type = UserPersistence.class)
1637 protected UserPersistence userPersistence;
1638 @BeanReference(type = UserGroupPersistence.class)
1639 protected UserGroupPersistence userGroupPersistence;
1640 @BeanReference(type = UserGroupGroupRolePersistence.class)
1641 protected UserGroupGroupRolePersistence userGroupGroupRolePersistence;
1642 @BeanReference(type = UserGroupRolePersistence.class)
1643 protected UserGroupRolePersistence userGroupRolePersistence;
1644 @BeanReference(type = UserIdMapperPersistence.class)
1645 protected UserIdMapperPersistence userIdMapperPersistence;
1646 @BeanReference(type = UserNotificationEventPersistence.class)
1647 protected UserNotificationEventPersistence userNotificationEventPersistence;
1648 @BeanReference(type = UserTrackerPersistence.class)
1649 protected UserTrackerPersistence userTrackerPersistence;
1650 @BeanReference(type = UserTrackerPathPersistence.class)
1651 protected UserTrackerPathPersistence userTrackerPathPersistence;
1652 @BeanReference(type = VirtualHostPersistence.class)
1653 protected VirtualHostPersistence virtualHostPersistence;
1654 @BeanReference(type = WebDAVPropsPersistence.class)
1655 protected WebDAVPropsPersistence webDAVPropsPersistence;
1656 @BeanReference(type = WebsitePersistence.class)
1657 protected WebsitePersistence websitePersistence;
1658 @BeanReference(type = WorkflowDefinitionLinkPersistence.class)
1659 protected WorkflowDefinitionLinkPersistence workflowDefinitionLinkPersistence;
1660 @BeanReference(type = WorkflowInstanceLinkPersistence.class)
1661 protected WorkflowInstanceLinkPersistence workflowInstanceLinkPersistence;
1662 private static final String _SQL_SELECT_ORGGROUPPERMISSION = "SELECT orgGroupPermission FROM OrgGroupPermission orgGroupPermission";
1663 private static final String _SQL_SELECT_ORGGROUPPERMISSION_WHERE = "SELECT orgGroupPermission FROM OrgGroupPermission orgGroupPermission WHERE ";
1664 private static final String _SQL_COUNT_ORGGROUPPERMISSION = "SELECT COUNT(orgGroupPermission) FROM OrgGroupPermission orgGroupPermission";
1665 private static final String _SQL_COUNT_ORGGROUPPERMISSION_WHERE = "SELECT COUNT(orgGroupPermission) FROM OrgGroupPermission orgGroupPermission WHERE ";
1666 private static final String _FINDER_COLUMN_GROUPID_GROUPID_2 = "orgGroupPermission.id.groupId = ?";
1667 private static final String _FINDER_COLUMN_PERMISSIONID_PERMISSIONID_2 = "orgGroupPermission.id.permissionId = ?";
1668 private static final String _ORDER_BY_ENTITY_ALIAS = "orgGroupPermission.";
1669 private static final String _NO_SUCH_ENTITY_WITH_PRIMARY_KEY = "No OrgGroupPermission exists with the primary key ";
1670 private static final String _NO_SUCH_ENTITY_WITH_KEY = "No OrgGroupPermission exists with the key {";
1671 private static final boolean _HIBERNATE_CACHE_USE_SECOND_LEVEL_CACHE = com.liferay.portal.util.PropsValues.HIBERNATE_CACHE_USE_SECOND_LEVEL_CACHE;
1672 private static Log _log = LogFactoryUtil.getLog(OrgGroupPermissionPersistenceImpl.class);
1673 private static OrgGroupPermission _nullOrgGroupPermission = new OrgGroupPermissionImpl() {
1674 @Override
1675 public Object clone() {
1676 return this;
1677 }
1678
1679 @Override
1680 public CacheModel<OrgGroupPermission> toCacheModel() {
1681 return _nullOrgGroupPermissionCacheModel;
1682 }
1683 };
1684
1685 private static CacheModel<OrgGroupPermission> _nullOrgGroupPermissionCacheModel =
1686 new CacheModel<OrgGroupPermission>() {
1687 public OrgGroupPermission toEntityModel() {
1688 return _nullOrgGroupPermission;
1689 }
1690 };
1691 }