1
14
15 package com.liferay.portal.service.persistence;
16
17 import com.liferay.portal.NoSuchModelException;
18 import com.liferay.portal.NoSuchUserGroupRoleException;
19 import com.liferay.portal.SystemException;
20 import com.liferay.portal.kernel.annotation.BeanReference;
21 import com.liferay.portal.kernel.cache.CacheRegistry;
22 import com.liferay.portal.kernel.dao.orm.DynamicQuery;
23 import com.liferay.portal.kernel.dao.orm.EntityCacheUtil;
24 import com.liferay.portal.kernel.dao.orm.FinderCacheUtil;
25 import com.liferay.portal.kernel.dao.orm.FinderPath;
26 import com.liferay.portal.kernel.dao.orm.Query;
27 import com.liferay.portal.kernel.dao.orm.QueryPos;
28 import com.liferay.portal.kernel.dao.orm.QueryUtil;
29 import com.liferay.portal.kernel.dao.orm.Session;
30 import com.liferay.portal.kernel.log.Log;
31 import com.liferay.portal.kernel.log.LogFactoryUtil;
32 import com.liferay.portal.kernel.util.GetterUtil;
33 import com.liferay.portal.kernel.util.OrderByComparator;
34 import com.liferay.portal.kernel.util.StringBundler;
35 import com.liferay.portal.kernel.util.StringPool;
36 import com.liferay.portal.kernel.util.StringUtil;
37 import com.liferay.portal.model.ModelListener;
38 import com.liferay.portal.model.UserGroupRole;
39 import com.liferay.portal.model.impl.UserGroupRoleImpl;
40 import com.liferay.portal.model.impl.UserGroupRoleModelImpl;
41 import com.liferay.portal.service.persistence.impl.BasePersistenceImpl;
42
43 import java.io.Serializable;
44
45 import java.util.ArrayList;
46 import java.util.Collections;
47 import java.util.List;
48
49
62 public class UserGroupRolePersistenceImpl extends BasePersistenceImpl<UserGroupRole>
63 implements UserGroupRolePersistence {
64 public static final String FINDER_CLASS_NAME_ENTITY = UserGroupRoleImpl.class.getName();
65 public static final String FINDER_CLASS_NAME_LIST = FINDER_CLASS_NAME_ENTITY +
66 ".List";
67 public static final FinderPath FINDER_PATH_FIND_BY_USERID = new FinderPath(UserGroupRoleModelImpl.ENTITY_CACHE_ENABLED,
68 UserGroupRoleModelImpl.FINDER_CACHE_ENABLED,
69 FINDER_CLASS_NAME_LIST, "findByUserId",
70 new String[] { Long.class.getName() });
71 public static final FinderPath FINDER_PATH_FIND_BY_OBC_USERID = new FinderPath(UserGroupRoleModelImpl.ENTITY_CACHE_ENABLED,
72 UserGroupRoleModelImpl.FINDER_CACHE_ENABLED,
73 FINDER_CLASS_NAME_LIST, "findByUserId",
74 new String[] {
75 Long.class.getName(),
76
77 "java.lang.Integer", "java.lang.Integer",
78 "com.liferay.portal.kernel.util.OrderByComparator"
79 });
80 public static final FinderPath FINDER_PATH_COUNT_BY_USERID = new FinderPath(UserGroupRoleModelImpl.ENTITY_CACHE_ENABLED,
81 UserGroupRoleModelImpl.FINDER_CACHE_ENABLED,
82 FINDER_CLASS_NAME_LIST, "countByUserId",
83 new String[] { Long.class.getName() });
84 public static final FinderPath FINDER_PATH_FIND_BY_GROUPID = new FinderPath(UserGroupRoleModelImpl.ENTITY_CACHE_ENABLED,
85 UserGroupRoleModelImpl.FINDER_CACHE_ENABLED,
86 FINDER_CLASS_NAME_LIST, "findByGroupId",
87 new String[] { Long.class.getName() });
88 public static final FinderPath FINDER_PATH_FIND_BY_OBC_GROUPID = new FinderPath(UserGroupRoleModelImpl.ENTITY_CACHE_ENABLED,
89 UserGroupRoleModelImpl.FINDER_CACHE_ENABLED,
90 FINDER_CLASS_NAME_LIST, "findByGroupId",
91 new String[] {
92 Long.class.getName(),
93
94 "java.lang.Integer", "java.lang.Integer",
95 "com.liferay.portal.kernel.util.OrderByComparator"
96 });
97 public static final FinderPath FINDER_PATH_COUNT_BY_GROUPID = new FinderPath(UserGroupRoleModelImpl.ENTITY_CACHE_ENABLED,
98 UserGroupRoleModelImpl.FINDER_CACHE_ENABLED,
99 FINDER_CLASS_NAME_LIST, "countByGroupId",
100 new String[] { Long.class.getName() });
101 public static final FinderPath FINDER_PATH_FIND_BY_ROLEID = new FinderPath(UserGroupRoleModelImpl.ENTITY_CACHE_ENABLED,
102 UserGroupRoleModelImpl.FINDER_CACHE_ENABLED,
103 FINDER_CLASS_NAME_LIST, "findByRoleId",
104 new String[] { Long.class.getName() });
105 public static final FinderPath FINDER_PATH_FIND_BY_OBC_ROLEID = new FinderPath(UserGroupRoleModelImpl.ENTITY_CACHE_ENABLED,
106 UserGroupRoleModelImpl.FINDER_CACHE_ENABLED,
107 FINDER_CLASS_NAME_LIST, "findByRoleId",
108 new String[] {
109 Long.class.getName(),
110
111 "java.lang.Integer", "java.lang.Integer",
112 "com.liferay.portal.kernel.util.OrderByComparator"
113 });
114 public static final FinderPath FINDER_PATH_COUNT_BY_ROLEID = new FinderPath(UserGroupRoleModelImpl.ENTITY_CACHE_ENABLED,
115 UserGroupRoleModelImpl.FINDER_CACHE_ENABLED,
116 FINDER_CLASS_NAME_LIST, "countByRoleId",
117 new String[] { Long.class.getName() });
118 public static final FinderPath FINDER_PATH_FIND_BY_U_G = new FinderPath(UserGroupRoleModelImpl.ENTITY_CACHE_ENABLED,
119 UserGroupRoleModelImpl.FINDER_CACHE_ENABLED,
120 FINDER_CLASS_NAME_LIST, "findByU_G",
121 new String[] { Long.class.getName(), Long.class.getName() });
122 public static final FinderPath FINDER_PATH_FIND_BY_OBC_U_G = new FinderPath(UserGroupRoleModelImpl.ENTITY_CACHE_ENABLED,
123 UserGroupRoleModelImpl.FINDER_CACHE_ENABLED,
124 FINDER_CLASS_NAME_LIST, "findByU_G",
125 new String[] {
126 Long.class.getName(), Long.class.getName(),
127
128 "java.lang.Integer", "java.lang.Integer",
129 "com.liferay.portal.kernel.util.OrderByComparator"
130 });
131 public static final FinderPath FINDER_PATH_COUNT_BY_U_G = new FinderPath(UserGroupRoleModelImpl.ENTITY_CACHE_ENABLED,
132 UserGroupRoleModelImpl.FINDER_CACHE_ENABLED,
133 FINDER_CLASS_NAME_LIST, "countByU_G",
134 new String[] { Long.class.getName(), Long.class.getName() });
135 public static final FinderPath FINDER_PATH_FIND_BY_G_R = new FinderPath(UserGroupRoleModelImpl.ENTITY_CACHE_ENABLED,
136 UserGroupRoleModelImpl.FINDER_CACHE_ENABLED,
137 FINDER_CLASS_NAME_LIST, "findByG_R",
138 new String[] { Long.class.getName(), Long.class.getName() });
139 public static final FinderPath FINDER_PATH_FIND_BY_OBC_G_R = new FinderPath(UserGroupRoleModelImpl.ENTITY_CACHE_ENABLED,
140 UserGroupRoleModelImpl.FINDER_CACHE_ENABLED,
141 FINDER_CLASS_NAME_LIST, "findByG_R",
142 new String[] {
143 Long.class.getName(), Long.class.getName(),
144
145 "java.lang.Integer", "java.lang.Integer",
146 "com.liferay.portal.kernel.util.OrderByComparator"
147 });
148 public static final FinderPath FINDER_PATH_COUNT_BY_G_R = new FinderPath(UserGroupRoleModelImpl.ENTITY_CACHE_ENABLED,
149 UserGroupRoleModelImpl.FINDER_CACHE_ENABLED,
150 FINDER_CLASS_NAME_LIST, "countByG_R",
151 new String[] { Long.class.getName(), Long.class.getName() });
152 public static final FinderPath FINDER_PATH_FIND_ALL = new FinderPath(UserGroupRoleModelImpl.ENTITY_CACHE_ENABLED,
153 UserGroupRoleModelImpl.FINDER_CACHE_ENABLED,
154 FINDER_CLASS_NAME_LIST, "findAll", new String[0]);
155 public static final FinderPath FINDER_PATH_COUNT_ALL = new FinderPath(UserGroupRoleModelImpl.ENTITY_CACHE_ENABLED,
156 UserGroupRoleModelImpl.FINDER_CACHE_ENABLED,
157 FINDER_CLASS_NAME_LIST, "countAll", new String[0]);
158
159 public void cacheResult(UserGroupRole userGroupRole) {
160 EntityCacheUtil.putResult(UserGroupRoleModelImpl.ENTITY_CACHE_ENABLED,
161 UserGroupRoleImpl.class, userGroupRole.getPrimaryKey(),
162 userGroupRole);
163 }
164
165 public void cacheResult(List<UserGroupRole> userGroupRoles) {
166 for (UserGroupRole userGroupRole : userGroupRoles) {
167 if (EntityCacheUtil.getResult(
168 UserGroupRoleModelImpl.ENTITY_CACHE_ENABLED,
169 UserGroupRoleImpl.class, userGroupRole.getPrimaryKey(),
170 this) == null) {
171 cacheResult(userGroupRole);
172 }
173 }
174 }
175
176 public void clearCache() {
177 CacheRegistry.clear(UserGroupRoleImpl.class.getName());
178 EntityCacheUtil.clearCache(UserGroupRoleImpl.class.getName());
179 FinderCacheUtil.clearCache(FINDER_CLASS_NAME_ENTITY);
180 FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST);
181 }
182
183 public UserGroupRole create(UserGroupRolePK userGroupRolePK) {
184 UserGroupRole userGroupRole = new UserGroupRoleImpl();
185
186 userGroupRole.setNew(true);
187 userGroupRole.setPrimaryKey(userGroupRolePK);
188
189 return userGroupRole;
190 }
191
192 public UserGroupRole remove(Serializable primaryKey)
193 throws NoSuchModelException, SystemException {
194 return remove((UserGroupRolePK)primaryKey);
195 }
196
197 public UserGroupRole remove(UserGroupRolePK userGroupRolePK)
198 throws NoSuchUserGroupRoleException, SystemException {
199 Session session = null;
200
201 try {
202 session = openSession();
203
204 UserGroupRole userGroupRole = (UserGroupRole)session.get(UserGroupRoleImpl.class,
205 userGroupRolePK);
206
207 if (userGroupRole == null) {
208 if (_log.isWarnEnabled()) {
209 _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
210 userGroupRolePK);
211 }
212
213 throw new NoSuchUserGroupRoleException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
214 userGroupRolePK);
215 }
216
217 return remove(userGroupRole);
218 }
219 catch (NoSuchUserGroupRoleException nsee) {
220 throw nsee;
221 }
222 catch (Exception e) {
223 throw processException(e);
224 }
225 finally {
226 closeSession(session);
227 }
228 }
229
230 public UserGroupRole remove(UserGroupRole userGroupRole)
231 throws SystemException {
232 for (ModelListener<UserGroupRole> listener : listeners) {
233 listener.onBeforeRemove(userGroupRole);
234 }
235
236 userGroupRole = removeImpl(userGroupRole);
237
238 for (ModelListener<UserGroupRole> listener : listeners) {
239 listener.onAfterRemove(userGroupRole);
240 }
241
242 return userGroupRole;
243 }
244
245 protected UserGroupRole removeImpl(UserGroupRole userGroupRole)
246 throws SystemException {
247 userGroupRole = toUnwrappedModel(userGroupRole);
248
249 Session session = null;
250
251 try {
252 session = openSession();
253
254 if (userGroupRole.isCachedModel() || BatchSessionUtil.isEnabled()) {
255 Object staleObject = session.get(UserGroupRoleImpl.class,
256 userGroupRole.getPrimaryKeyObj());
257
258 if (staleObject != null) {
259 session.evict(staleObject);
260 }
261 }
262
263 session.delete(userGroupRole);
264
265 session.flush();
266 }
267 catch (Exception e) {
268 throw processException(e);
269 }
270 finally {
271 closeSession(session);
272 }
273
274 FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST);
275
276 EntityCacheUtil.removeResult(UserGroupRoleModelImpl.ENTITY_CACHE_ENABLED,
277 UserGroupRoleImpl.class, userGroupRole.getPrimaryKey());
278
279 return userGroupRole;
280 }
281
282
285 public UserGroupRole update(UserGroupRole userGroupRole)
286 throws SystemException {
287 if (_log.isWarnEnabled()) {
288 _log.warn(
289 "Using the deprecated update(UserGroupRole userGroupRole) method. Use update(UserGroupRole userGroupRole, boolean merge) instead.");
290 }
291
292 return update(userGroupRole, false);
293 }
294
295 public UserGroupRole updateImpl(
296 com.liferay.portal.model.UserGroupRole userGroupRole, boolean merge)
297 throws SystemException {
298 userGroupRole = toUnwrappedModel(userGroupRole);
299
300 Session session = null;
301
302 try {
303 session = openSession();
304
305 BatchSessionUtil.update(session, userGroupRole, merge);
306
307 userGroupRole.setNew(false);
308 }
309 catch (Exception e) {
310 throw processException(e);
311 }
312 finally {
313 closeSession(session);
314 }
315
316 FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST);
317
318 EntityCacheUtil.putResult(UserGroupRoleModelImpl.ENTITY_CACHE_ENABLED,
319 UserGroupRoleImpl.class, userGroupRole.getPrimaryKey(),
320 userGroupRole);
321
322 return userGroupRole;
323 }
324
325 protected UserGroupRole toUnwrappedModel(UserGroupRole userGroupRole) {
326 if (userGroupRole instanceof UserGroupRoleImpl) {
327 return userGroupRole;
328 }
329
330 UserGroupRoleImpl userGroupRoleImpl = new UserGroupRoleImpl();
331
332 userGroupRoleImpl.setNew(userGroupRole.isNew());
333 userGroupRoleImpl.setPrimaryKey(userGroupRole.getPrimaryKey());
334
335 userGroupRoleImpl.setUserId(userGroupRole.getUserId());
336 userGroupRoleImpl.setGroupId(userGroupRole.getGroupId());
337 userGroupRoleImpl.setRoleId(userGroupRole.getRoleId());
338
339 return userGroupRoleImpl;
340 }
341
342 public UserGroupRole findByPrimaryKey(Serializable primaryKey)
343 throws NoSuchModelException, SystemException {
344 return findByPrimaryKey((UserGroupRolePK)primaryKey);
345 }
346
347 public UserGroupRole findByPrimaryKey(UserGroupRolePK userGroupRolePK)
348 throws NoSuchUserGroupRoleException, SystemException {
349 UserGroupRole userGroupRole = fetchByPrimaryKey(userGroupRolePK);
350
351 if (userGroupRole == null) {
352 if (_log.isWarnEnabled()) {
353 _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + userGroupRolePK);
354 }
355
356 throw new NoSuchUserGroupRoleException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
357 userGroupRolePK);
358 }
359
360 return userGroupRole;
361 }
362
363 public UserGroupRole fetchByPrimaryKey(Serializable primaryKey)
364 throws SystemException {
365 return fetchByPrimaryKey((UserGroupRolePK)primaryKey);
366 }
367
368 public UserGroupRole fetchByPrimaryKey(UserGroupRolePK userGroupRolePK)
369 throws SystemException {
370 UserGroupRole userGroupRole = (UserGroupRole)EntityCacheUtil.getResult(UserGroupRoleModelImpl.ENTITY_CACHE_ENABLED,
371 UserGroupRoleImpl.class, userGroupRolePK, this);
372
373 if (userGroupRole == null) {
374 Session session = null;
375
376 try {
377 session = openSession();
378
379 userGroupRole = (UserGroupRole)session.get(UserGroupRoleImpl.class,
380 userGroupRolePK);
381 }
382 catch (Exception e) {
383 throw processException(e);
384 }
385 finally {
386 if (userGroupRole != null) {
387 cacheResult(userGroupRole);
388 }
389
390 closeSession(session);
391 }
392 }
393
394 return userGroupRole;
395 }
396
397 public List<UserGroupRole> findByUserId(long userId)
398 throws SystemException {
399 Object[] finderArgs = new Object[] { new Long(userId) };
400
401 List<UserGroupRole> list = (List<UserGroupRole>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_USERID,
402 finderArgs, this);
403
404 if (list == null) {
405 Session session = null;
406
407 try {
408 session = openSession();
409
410 StringBundler query = new StringBundler(2);
411
412 query.append(_SQL_SELECT_USERGROUPROLE_WHERE);
413
414 query.append(_FINDER_COLUMN_USERID_USERID_2);
415
416 String sql = query.toString();
417
418 Query q = session.createQuery(sql);
419
420 QueryPos qPos = QueryPos.getInstance(q);
421
422 qPos.add(userId);
423
424 list = q.list();
425 }
426 catch (Exception e) {
427 throw processException(e);
428 }
429 finally {
430 if (list == null) {
431 list = new ArrayList<UserGroupRole>();
432 }
433
434 cacheResult(list);
435
436 FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_USERID,
437 finderArgs, list);
438
439 closeSession(session);
440 }
441 }
442
443 return list;
444 }
445
446 public List<UserGroupRole> findByUserId(long userId, int start, int end)
447 throws SystemException {
448 return findByUserId(userId, start, end, null);
449 }
450
451 public List<UserGroupRole> findByUserId(long userId, int start, int end,
452 OrderByComparator obc) throws SystemException {
453 Object[] finderArgs = new Object[] {
454 new Long(userId),
455
456 String.valueOf(start), String.valueOf(end), String.valueOf(obc)
457 };
458
459 List<UserGroupRole> list = (List<UserGroupRole>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_OBC_USERID,
460 finderArgs, this);
461
462 if (list == null) {
463 Session session = null;
464
465 try {
466 session = openSession();
467
468 StringBundler query = null;
469
470 if (obc != null) {
471 query = new StringBundler(3 +
472 (obc.getOrderByFields().length * 3));
473 }
474 else {
475 query = new StringBundler(2);
476 }
477
478 query.append(_SQL_SELECT_USERGROUPROLE_WHERE);
479
480 query.append(_FINDER_COLUMN_USERID_USERID_2);
481
482 if (obc != null) {
483 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS, obc);
484 }
485
486 String sql = query.toString();
487
488 Query q = session.createQuery(sql);
489
490 QueryPos qPos = QueryPos.getInstance(q);
491
492 qPos.add(userId);
493
494 list = (List<UserGroupRole>)QueryUtil.list(q, getDialect(),
495 start, end);
496 }
497 catch (Exception e) {
498 throw processException(e);
499 }
500 finally {
501 if (list == null) {
502 list = new ArrayList<UserGroupRole>();
503 }
504
505 cacheResult(list);
506
507 FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_OBC_USERID,
508 finderArgs, list);
509
510 closeSession(session);
511 }
512 }
513
514 return list;
515 }
516
517 public UserGroupRole findByUserId_First(long userId, OrderByComparator obc)
518 throws NoSuchUserGroupRoleException, SystemException {
519 List<UserGroupRole> list = findByUserId(userId, 0, 1, obc);
520
521 if (list.isEmpty()) {
522 StringBundler msg = new StringBundler(4);
523
524 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
525
526 msg.append("userId=");
527 msg.append(userId);
528
529 msg.append(StringPool.CLOSE_CURLY_BRACE);
530
531 throw new NoSuchUserGroupRoleException(msg.toString());
532 }
533 else {
534 return list.get(0);
535 }
536 }
537
538 public UserGroupRole findByUserId_Last(long userId, OrderByComparator obc)
539 throws NoSuchUserGroupRoleException, SystemException {
540 int count = countByUserId(userId);
541
542 List<UserGroupRole> list = findByUserId(userId, count - 1, count, obc);
543
544 if (list.isEmpty()) {
545 StringBundler msg = new StringBundler(4);
546
547 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
548
549 msg.append("userId=");
550 msg.append(userId);
551
552 msg.append(StringPool.CLOSE_CURLY_BRACE);
553
554 throw new NoSuchUserGroupRoleException(msg.toString());
555 }
556 else {
557 return list.get(0);
558 }
559 }
560
561 public UserGroupRole[] findByUserId_PrevAndNext(
562 UserGroupRolePK userGroupRolePK, long userId, OrderByComparator obc)
563 throws NoSuchUserGroupRoleException, SystemException {
564 UserGroupRole userGroupRole = findByPrimaryKey(userGroupRolePK);
565
566 int count = countByUserId(userId);
567
568 Session session = null;
569
570 try {
571 session = openSession();
572
573 StringBundler query = null;
574
575 if (obc != null) {
576 query = new StringBundler(3 +
577 (obc.getOrderByFields().length * 3));
578 }
579 else {
580 query = new StringBundler(2);
581 }
582
583 query.append(_SQL_SELECT_USERGROUPROLE_WHERE);
584
585 query.append(_FINDER_COLUMN_USERID_USERID_2);
586
587 if (obc != null) {
588 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS, obc);
589 }
590
591 String sql = query.toString();
592
593 Query q = session.createQuery(sql);
594
595 QueryPos qPos = QueryPos.getInstance(q);
596
597 qPos.add(userId);
598
599 Object[] objArray = QueryUtil.getPrevAndNext(q, count, obc,
600 userGroupRole);
601
602 UserGroupRole[] array = new UserGroupRoleImpl[3];
603
604 array[0] = (UserGroupRole)objArray[0];
605 array[1] = (UserGroupRole)objArray[1];
606 array[2] = (UserGroupRole)objArray[2];
607
608 return array;
609 }
610 catch (Exception e) {
611 throw processException(e);
612 }
613 finally {
614 closeSession(session);
615 }
616 }
617
618 public List<UserGroupRole> findByGroupId(long groupId)
619 throws SystemException {
620 Object[] finderArgs = new Object[] { new Long(groupId) };
621
622 List<UserGroupRole> list = (List<UserGroupRole>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_GROUPID,
623 finderArgs, this);
624
625 if (list == null) {
626 Session session = null;
627
628 try {
629 session = openSession();
630
631 StringBundler query = new StringBundler(2);
632
633 query.append(_SQL_SELECT_USERGROUPROLE_WHERE);
634
635 query.append(_FINDER_COLUMN_GROUPID_GROUPID_2);
636
637 String sql = query.toString();
638
639 Query q = session.createQuery(sql);
640
641 QueryPos qPos = QueryPos.getInstance(q);
642
643 qPos.add(groupId);
644
645 list = q.list();
646 }
647 catch (Exception e) {
648 throw processException(e);
649 }
650 finally {
651 if (list == null) {
652 list = new ArrayList<UserGroupRole>();
653 }
654
655 cacheResult(list);
656
657 FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_GROUPID,
658 finderArgs, list);
659
660 closeSession(session);
661 }
662 }
663
664 return list;
665 }
666
667 public List<UserGroupRole> findByGroupId(long groupId, int start, int end)
668 throws SystemException {
669 return findByGroupId(groupId, start, end, null);
670 }
671
672 public List<UserGroupRole> findByGroupId(long groupId, int start, int end,
673 OrderByComparator obc) throws SystemException {
674 Object[] finderArgs = new Object[] {
675 new Long(groupId),
676
677 String.valueOf(start), String.valueOf(end), String.valueOf(obc)
678 };
679
680 List<UserGroupRole> list = (List<UserGroupRole>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_OBC_GROUPID,
681 finderArgs, this);
682
683 if (list == null) {
684 Session session = null;
685
686 try {
687 session = openSession();
688
689 StringBundler query = null;
690
691 if (obc != null) {
692 query = new StringBundler(3 +
693 (obc.getOrderByFields().length * 3));
694 }
695 else {
696 query = new StringBundler(2);
697 }
698
699 query.append(_SQL_SELECT_USERGROUPROLE_WHERE);
700
701 query.append(_FINDER_COLUMN_GROUPID_GROUPID_2);
702
703 if (obc != null) {
704 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS, obc);
705 }
706
707 String sql = query.toString();
708
709 Query q = session.createQuery(sql);
710
711 QueryPos qPos = QueryPos.getInstance(q);
712
713 qPos.add(groupId);
714
715 list = (List<UserGroupRole>)QueryUtil.list(q, getDialect(),
716 start, end);
717 }
718 catch (Exception e) {
719 throw processException(e);
720 }
721 finally {
722 if (list == null) {
723 list = new ArrayList<UserGroupRole>();
724 }
725
726 cacheResult(list);
727
728 FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_OBC_GROUPID,
729 finderArgs, list);
730
731 closeSession(session);
732 }
733 }
734
735 return list;
736 }
737
738 public UserGroupRole findByGroupId_First(long groupId, OrderByComparator obc)
739 throws NoSuchUserGroupRoleException, SystemException {
740 List<UserGroupRole> list = findByGroupId(groupId, 0, 1, obc);
741
742 if (list.isEmpty()) {
743 StringBundler msg = new StringBundler(4);
744
745 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
746
747 msg.append("groupId=");
748 msg.append(groupId);
749
750 msg.append(StringPool.CLOSE_CURLY_BRACE);
751
752 throw new NoSuchUserGroupRoleException(msg.toString());
753 }
754 else {
755 return list.get(0);
756 }
757 }
758
759 public UserGroupRole findByGroupId_Last(long groupId, OrderByComparator obc)
760 throws NoSuchUserGroupRoleException, SystemException {
761 int count = countByGroupId(groupId);
762
763 List<UserGroupRole> list = findByGroupId(groupId, count - 1, count, obc);
764
765 if (list.isEmpty()) {
766 StringBundler msg = new StringBundler(4);
767
768 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
769
770 msg.append("groupId=");
771 msg.append(groupId);
772
773 msg.append(StringPool.CLOSE_CURLY_BRACE);
774
775 throw new NoSuchUserGroupRoleException(msg.toString());
776 }
777 else {
778 return list.get(0);
779 }
780 }
781
782 public UserGroupRole[] findByGroupId_PrevAndNext(
783 UserGroupRolePK userGroupRolePK, long groupId, OrderByComparator obc)
784 throws NoSuchUserGroupRoleException, SystemException {
785 UserGroupRole userGroupRole = findByPrimaryKey(userGroupRolePK);
786
787 int count = countByGroupId(groupId);
788
789 Session session = null;
790
791 try {
792 session = openSession();
793
794 StringBundler query = null;
795
796 if (obc != null) {
797 query = new StringBundler(3 +
798 (obc.getOrderByFields().length * 3));
799 }
800 else {
801 query = new StringBundler(2);
802 }
803
804 query.append(_SQL_SELECT_USERGROUPROLE_WHERE);
805
806 query.append(_FINDER_COLUMN_GROUPID_GROUPID_2);
807
808 if (obc != null) {
809 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS, obc);
810 }
811
812 String sql = query.toString();
813
814 Query q = session.createQuery(sql);
815
816 QueryPos qPos = QueryPos.getInstance(q);
817
818 qPos.add(groupId);
819
820 Object[] objArray = QueryUtil.getPrevAndNext(q, count, obc,
821 userGroupRole);
822
823 UserGroupRole[] array = new UserGroupRoleImpl[3];
824
825 array[0] = (UserGroupRole)objArray[0];
826 array[1] = (UserGroupRole)objArray[1];
827 array[2] = (UserGroupRole)objArray[2];
828
829 return array;
830 }
831 catch (Exception e) {
832 throw processException(e);
833 }
834 finally {
835 closeSession(session);
836 }
837 }
838
839 public List<UserGroupRole> findByRoleId(long roleId)
840 throws SystemException {
841 Object[] finderArgs = new Object[] { new Long(roleId) };
842
843 List<UserGroupRole> list = (List<UserGroupRole>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_ROLEID,
844 finderArgs, this);
845
846 if (list == null) {
847 Session session = null;
848
849 try {
850 session = openSession();
851
852 StringBundler query = new StringBundler(2);
853
854 query.append(_SQL_SELECT_USERGROUPROLE_WHERE);
855
856 query.append(_FINDER_COLUMN_ROLEID_ROLEID_2);
857
858 String sql = query.toString();
859
860 Query q = session.createQuery(sql);
861
862 QueryPos qPos = QueryPos.getInstance(q);
863
864 qPos.add(roleId);
865
866 list = q.list();
867 }
868 catch (Exception e) {
869 throw processException(e);
870 }
871 finally {
872 if (list == null) {
873 list = new ArrayList<UserGroupRole>();
874 }
875
876 cacheResult(list);
877
878 FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_ROLEID,
879 finderArgs, list);
880
881 closeSession(session);
882 }
883 }
884
885 return list;
886 }
887
888 public List<UserGroupRole> findByRoleId(long roleId, int start, int end)
889 throws SystemException {
890 return findByRoleId(roleId, start, end, null);
891 }
892
893 public List<UserGroupRole> findByRoleId(long roleId, int start, int end,
894 OrderByComparator obc) throws SystemException {
895 Object[] finderArgs = new Object[] {
896 new Long(roleId),
897
898 String.valueOf(start), String.valueOf(end), String.valueOf(obc)
899 };
900
901 List<UserGroupRole> list = (List<UserGroupRole>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_OBC_ROLEID,
902 finderArgs, this);
903
904 if (list == null) {
905 Session session = null;
906
907 try {
908 session = openSession();
909
910 StringBundler query = null;
911
912 if (obc != null) {
913 query = new StringBundler(3 +
914 (obc.getOrderByFields().length * 3));
915 }
916 else {
917 query = new StringBundler(2);
918 }
919
920 query.append(_SQL_SELECT_USERGROUPROLE_WHERE);
921
922 query.append(_FINDER_COLUMN_ROLEID_ROLEID_2);
923
924 if (obc != null) {
925 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS, obc);
926 }
927
928 String sql = query.toString();
929
930 Query q = session.createQuery(sql);
931
932 QueryPos qPos = QueryPos.getInstance(q);
933
934 qPos.add(roleId);
935
936 list = (List<UserGroupRole>)QueryUtil.list(q, getDialect(),
937 start, end);
938 }
939 catch (Exception e) {
940 throw processException(e);
941 }
942 finally {
943 if (list == null) {
944 list = new ArrayList<UserGroupRole>();
945 }
946
947 cacheResult(list);
948
949 FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_OBC_ROLEID,
950 finderArgs, list);
951
952 closeSession(session);
953 }
954 }
955
956 return list;
957 }
958
959 public UserGroupRole findByRoleId_First(long roleId, OrderByComparator obc)
960 throws NoSuchUserGroupRoleException, SystemException {
961 List<UserGroupRole> list = findByRoleId(roleId, 0, 1, obc);
962
963 if (list.isEmpty()) {
964 StringBundler msg = new StringBundler(4);
965
966 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
967
968 msg.append("roleId=");
969 msg.append(roleId);
970
971 msg.append(StringPool.CLOSE_CURLY_BRACE);
972
973 throw new NoSuchUserGroupRoleException(msg.toString());
974 }
975 else {
976 return list.get(0);
977 }
978 }
979
980 public UserGroupRole findByRoleId_Last(long roleId, OrderByComparator obc)
981 throws NoSuchUserGroupRoleException, SystemException {
982 int count = countByRoleId(roleId);
983
984 List<UserGroupRole> list = findByRoleId(roleId, count - 1, count, obc);
985
986 if (list.isEmpty()) {
987 StringBundler msg = new StringBundler(4);
988
989 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
990
991 msg.append("roleId=");
992 msg.append(roleId);
993
994 msg.append(StringPool.CLOSE_CURLY_BRACE);
995
996 throw new NoSuchUserGroupRoleException(msg.toString());
997 }
998 else {
999 return list.get(0);
1000 }
1001 }
1002
1003 public UserGroupRole[] findByRoleId_PrevAndNext(
1004 UserGroupRolePK userGroupRolePK, long roleId, OrderByComparator obc)
1005 throws NoSuchUserGroupRoleException, SystemException {
1006 UserGroupRole userGroupRole = findByPrimaryKey(userGroupRolePK);
1007
1008 int count = countByRoleId(roleId);
1009
1010 Session session = null;
1011
1012 try {
1013 session = openSession();
1014
1015 StringBundler query = null;
1016
1017 if (obc != null) {
1018 query = new StringBundler(3 +
1019 (obc.getOrderByFields().length * 3));
1020 }
1021 else {
1022 query = new StringBundler(2);
1023 }
1024
1025 query.append(_SQL_SELECT_USERGROUPROLE_WHERE);
1026
1027 query.append(_FINDER_COLUMN_ROLEID_ROLEID_2);
1028
1029 if (obc != null) {
1030 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS, obc);
1031 }
1032
1033 String sql = query.toString();
1034
1035 Query q = session.createQuery(sql);
1036
1037 QueryPos qPos = QueryPos.getInstance(q);
1038
1039 qPos.add(roleId);
1040
1041 Object[] objArray = QueryUtil.getPrevAndNext(q, count, obc,
1042 userGroupRole);
1043
1044 UserGroupRole[] array = new UserGroupRoleImpl[3];
1045
1046 array[0] = (UserGroupRole)objArray[0];
1047 array[1] = (UserGroupRole)objArray[1];
1048 array[2] = (UserGroupRole)objArray[2];
1049
1050 return array;
1051 }
1052 catch (Exception e) {
1053 throw processException(e);
1054 }
1055 finally {
1056 closeSession(session);
1057 }
1058 }
1059
1060 public List<UserGroupRole> findByU_G(long userId, long groupId)
1061 throws SystemException {
1062 Object[] finderArgs = new Object[] { new Long(userId), new Long(groupId) };
1063
1064 List<UserGroupRole> list = (List<UserGroupRole>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_U_G,
1065 finderArgs, this);
1066
1067 if (list == null) {
1068 Session session = null;
1069
1070 try {
1071 session = openSession();
1072
1073 StringBundler query = new StringBundler(3);
1074
1075 query.append(_SQL_SELECT_USERGROUPROLE_WHERE);
1076
1077 query.append(_FINDER_COLUMN_U_G_USERID_2);
1078
1079 query.append(_FINDER_COLUMN_U_G_GROUPID_2);
1080
1081 String sql = query.toString();
1082
1083 Query q = session.createQuery(sql);
1084
1085 QueryPos qPos = QueryPos.getInstance(q);
1086
1087 qPos.add(userId);
1088
1089 qPos.add(groupId);
1090
1091 list = q.list();
1092 }
1093 catch (Exception e) {
1094 throw processException(e);
1095 }
1096 finally {
1097 if (list == null) {
1098 list = new ArrayList<UserGroupRole>();
1099 }
1100
1101 cacheResult(list);
1102
1103 FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_U_G, finderArgs,
1104 list);
1105
1106 closeSession(session);
1107 }
1108 }
1109
1110 return list;
1111 }
1112
1113 public List<UserGroupRole> findByU_G(long userId, long groupId, int start,
1114 int end) throws SystemException {
1115 return findByU_G(userId, groupId, start, end, null);
1116 }
1117
1118 public List<UserGroupRole> findByU_G(long userId, long groupId, int start,
1119 int end, OrderByComparator obc) throws SystemException {
1120 Object[] finderArgs = new Object[] {
1121 new Long(userId), new Long(groupId),
1122
1123 String.valueOf(start), String.valueOf(end), String.valueOf(obc)
1124 };
1125
1126 List<UserGroupRole> list = (List<UserGroupRole>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_OBC_U_G,
1127 finderArgs, this);
1128
1129 if (list == null) {
1130 Session session = null;
1131
1132 try {
1133 session = openSession();
1134
1135 StringBundler query = null;
1136
1137 if (obc != null) {
1138 query = new StringBundler(4 +
1139 (obc.getOrderByFields().length * 3));
1140 }
1141 else {
1142 query = new StringBundler(3);
1143 }
1144
1145 query.append(_SQL_SELECT_USERGROUPROLE_WHERE);
1146
1147 query.append(_FINDER_COLUMN_U_G_USERID_2);
1148
1149 query.append(_FINDER_COLUMN_U_G_GROUPID_2);
1150
1151 if (obc != null) {
1152 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS, obc);
1153 }
1154
1155 String sql = query.toString();
1156
1157 Query q = session.createQuery(sql);
1158
1159 QueryPos qPos = QueryPos.getInstance(q);
1160
1161 qPos.add(userId);
1162
1163 qPos.add(groupId);
1164
1165 list = (List<UserGroupRole>)QueryUtil.list(q, getDialect(),
1166 start, end);
1167 }
1168 catch (Exception e) {
1169 throw processException(e);
1170 }
1171 finally {
1172 if (list == null) {
1173 list = new ArrayList<UserGroupRole>();
1174 }
1175
1176 cacheResult(list);
1177
1178 FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_OBC_U_G,
1179 finderArgs, list);
1180
1181 closeSession(session);
1182 }
1183 }
1184
1185 return list;
1186 }
1187
1188 public UserGroupRole findByU_G_First(long userId, long groupId,
1189 OrderByComparator obc)
1190 throws NoSuchUserGroupRoleException, SystemException {
1191 List<UserGroupRole> list = findByU_G(userId, groupId, 0, 1, obc);
1192
1193 if (list.isEmpty()) {
1194 StringBundler msg = new StringBundler(6);
1195
1196 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
1197
1198 msg.append("userId=");
1199 msg.append(userId);
1200
1201 msg.append(", groupId=");
1202 msg.append(groupId);
1203
1204 msg.append(StringPool.CLOSE_CURLY_BRACE);
1205
1206 throw new NoSuchUserGroupRoleException(msg.toString());
1207 }
1208 else {
1209 return list.get(0);
1210 }
1211 }
1212
1213 public UserGroupRole findByU_G_Last(long userId, long groupId,
1214 OrderByComparator obc)
1215 throws NoSuchUserGroupRoleException, SystemException {
1216 int count = countByU_G(userId, groupId);
1217
1218 List<UserGroupRole> list = findByU_G(userId, groupId, count - 1, count,
1219 obc);
1220
1221 if (list.isEmpty()) {
1222 StringBundler msg = new StringBundler(6);
1223
1224 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
1225
1226 msg.append("userId=");
1227 msg.append(userId);
1228
1229 msg.append(", groupId=");
1230 msg.append(groupId);
1231
1232 msg.append(StringPool.CLOSE_CURLY_BRACE);
1233
1234 throw new NoSuchUserGroupRoleException(msg.toString());
1235 }
1236 else {
1237 return list.get(0);
1238 }
1239 }
1240
1241 public UserGroupRole[] findByU_G_PrevAndNext(
1242 UserGroupRolePK userGroupRolePK, long userId, long groupId,
1243 OrderByComparator obc)
1244 throws NoSuchUserGroupRoleException, SystemException {
1245 UserGroupRole userGroupRole = findByPrimaryKey(userGroupRolePK);
1246
1247 int count = countByU_G(userId, groupId);
1248
1249 Session session = null;
1250
1251 try {
1252 session = openSession();
1253
1254 StringBundler query = null;
1255
1256 if (obc != null) {
1257 query = new StringBundler(4 +
1258 (obc.getOrderByFields().length * 3));
1259 }
1260 else {
1261 query = new StringBundler(3);
1262 }
1263
1264 query.append(_SQL_SELECT_USERGROUPROLE_WHERE);
1265
1266 query.append(_FINDER_COLUMN_U_G_USERID_2);
1267
1268 query.append(_FINDER_COLUMN_U_G_GROUPID_2);
1269
1270 if (obc != null) {
1271 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS, obc);
1272 }
1273
1274 String sql = query.toString();
1275
1276 Query q = session.createQuery(sql);
1277
1278 QueryPos qPos = QueryPos.getInstance(q);
1279
1280 qPos.add(userId);
1281
1282 qPos.add(groupId);
1283
1284 Object[] objArray = QueryUtil.getPrevAndNext(q, count, obc,
1285 userGroupRole);
1286
1287 UserGroupRole[] array = new UserGroupRoleImpl[3];
1288
1289 array[0] = (UserGroupRole)objArray[0];
1290 array[1] = (UserGroupRole)objArray[1];
1291 array[2] = (UserGroupRole)objArray[2];
1292
1293 return array;
1294 }
1295 catch (Exception e) {
1296 throw processException(e);
1297 }
1298 finally {
1299 closeSession(session);
1300 }
1301 }
1302
1303 public List<UserGroupRole> findByG_R(long groupId, long roleId)
1304 throws SystemException {
1305 Object[] finderArgs = new Object[] { new Long(groupId), new Long(roleId) };
1306
1307 List<UserGroupRole> list = (List<UserGroupRole>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_G_R,
1308 finderArgs, this);
1309
1310 if (list == null) {
1311 Session session = null;
1312
1313 try {
1314 session = openSession();
1315
1316 StringBundler query = new StringBundler(3);
1317
1318 query.append(_SQL_SELECT_USERGROUPROLE_WHERE);
1319
1320 query.append(_FINDER_COLUMN_G_R_GROUPID_2);
1321
1322 query.append(_FINDER_COLUMN_G_R_ROLEID_2);
1323
1324 String sql = query.toString();
1325
1326 Query q = session.createQuery(sql);
1327
1328 QueryPos qPos = QueryPos.getInstance(q);
1329
1330 qPos.add(groupId);
1331
1332 qPos.add(roleId);
1333
1334 list = q.list();
1335 }
1336 catch (Exception e) {
1337 throw processException(e);
1338 }
1339 finally {
1340 if (list == null) {
1341 list = new ArrayList<UserGroupRole>();
1342 }
1343
1344 cacheResult(list);
1345
1346 FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_G_R, finderArgs,
1347 list);
1348
1349 closeSession(session);
1350 }
1351 }
1352
1353 return list;
1354 }
1355
1356 public List<UserGroupRole> findByG_R(long groupId, long roleId, int start,
1357 int end) throws SystemException {
1358 return findByG_R(groupId, roleId, start, end, null);
1359 }
1360
1361 public List<UserGroupRole> findByG_R(long groupId, long roleId, int start,
1362 int end, OrderByComparator obc) throws SystemException {
1363 Object[] finderArgs = new Object[] {
1364 new Long(groupId), new Long(roleId),
1365
1366 String.valueOf(start), String.valueOf(end), String.valueOf(obc)
1367 };
1368
1369 List<UserGroupRole> list = (List<UserGroupRole>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_OBC_G_R,
1370 finderArgs, this);
1371
1372 if (list == null) {
1373 Session session = null;
1374
1375 try {
1376 session = openSession();
1377
1378 StringBundler query = null;
1379
1380 if (obc != null) {
1381 query = new StringBundler(4 +
1382 (obc.getOrderByFields().length * 3));
1383 }
1384 else {
1385 query = new StringBundler(3);
1386 }
1387
1388 query.append(_SQL_SELECT_USERGROUPROLE_WHERE);
1389
1390 query.append(_FINDER_COLUMN_G_R_GROUPID_2);
1391
1392 query.append(_FINDER_COLUMN_G_R_ROLEID_2);
1393
1394 if (obc != null) {
1395 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS, obc);
1396 }
1397
1398 String sql = query.toString();
1399
1400 Query q = session.createQuery(sql);
1401
1402 QueryPos qPos = QueryPos.getInstance(q);
1403
1404 qPos.add(groupId);
1405
1406 qPos.add(roleId);
1407
1408 list = (List<UserGroupRole>)QueryUtil.list(q, getDialect(),
1409 start, end);
1410 }
1411 catch (Exception e) {
1412 throw processException(e);
1413 }
1414 finally {
1415 if (list == null) {
1416 list = new ArrayList<UserGroupRole>();
1417 }
1418
1419 cacheResult(list);
1420
1421 FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_OBC_G_R,
1422 finderArgs, list);
1423
1424 closeSession(session);
1425 }
1426 }
1427
1428 return list;
1429 }
1430
1431 public UserGroupRole findByG_R_First(long groupId, long roleId,
1432 OrderByComparator obc)
1433 throws NoSuchUserGroupRoleException, SystemException {
1434 List<UserGroupRole> list = findByG_R(groupId, roleId, 0, 1, obc);
1435
1436 if (list.isEmpty()) {
1437 StringBundler msg = new StringBundler(6);
1438
1439 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
1440
1441 msg.append("groupId=");
1442 msg.append(groupId);
1443
1444 msg.append(", roleId=");
1445 msg.append(roleId);
1446
1447 msg.append(StringPool.CLOSE_CURLY_BRACE);
1448
1449 throw new NoSuchUserGroupRoleException(msg.toString());
1450 }
1451 else {
1452 return list.get(0);
1453 }
1454 }
1455
1456 public UserGroupRole findByG_R_Last(long groupId, long roleId,
1457 OrderByComparator obc)
1458 throws NoSuchUserGroupRoleException, SystemException {
1459 int count = countByG_R(groupId, roleId);
1460
1461 List<UserGroupRole> list = findByG_R(groupId, roleId, count - 1, count,
1462 obc);
1463
1464 if (list.isEmpty()) {
1465 StringBundler msg = new StringBundler(6);
1466
1467 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
1468
1469 msg.append("groupId=");
1470 msg.append(groupId);
1471
1472 msg.append(", roleId=");
1473 msg.append(roleId);
1474
1475 msg.append(StringPool.CLOSE_CURLY_BRACE);
1476
1477 throw new NoSuchUserGroupRoleException(msg.toString());
1478 }
1479 else {
1480 return list.get(0);
1481 }
1482 }
1483
1484 public UserGroupRole[] findByG_R_PrevAndNext(
1485 UserGroupRolePK userGroupRolePK, long groupId, long roleId,
1486 OrderByComparator obc)
1487 throws NoSuchUserGroupRoleException, SystemException {
1488 UserGroupRole userGroupRole = findByPrimaryKey(userGroupRolePK);
1489
1490 int count = countByG_R(groupId, roleId);
1491
1492 Session session = null;
1493
1494 try {
1495 session = openSession();
1496
1497 StringBundler query = null;
1498
1499 if (obc != null) {
1500 query = new StringBundler(4 +
1501 (obc.getOrderByFields().length * 3));
1502 }
1503 else {
1504 query = new StringBundler(3);
1505 }
1506
1507 query.append(_SQL_SELECT_USERGROUPROLE_WHERE);
1508
1509 query.append(_FINDER_COLUMN_G_R_GROUPID_2);
1510
1511 query.append(_FINDER_COLUMN_G_R_ROLEID_2);
1512
1513 if (obc != null) {
1514 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS, obc);
1515 }
1516
1517 String sql = query.toString();
1518
1519 Query q = session.createQuery(sql);
1520
1521 QueryPos qPos = QueryPos.getInstance(q);
1522
1523 qPos.add(groupId);
1524
1525 qPos.add(roleId);
1526
1527 Object[] objArray = QueryUtil.getPrevAndNext(q, count, obc,
1528 userGroupRole);
1529
1530 UserGroupRole[] array = new UserGroupRoleImpl[3];
1531
1532 array[0] = (UserGroupRole)objArray[0];
1533 array[1] = (UserGroupRole)objArray[1];
1534 array[2] = (UserGroupRole)objArray[2];
1535
1536 return array;
1537 }
1538 catch (Exception e) {
1539 throw processException(e);
1540 }
1541 finally {
1542 closeSession(session);
1543 }
1544 }
1545
1546 public List<Object> findWithDynamicQuery(DynamicQuery dynamicQuery)
1547 throws SystemException {
1548 Session session = null;
1549
1550 try {
1551 session = openSession();
1552
1553 dynamicQuery.compile(session);
1554
1555 return dynamicQuery.list();
1556 }
1557 catch (Exception e) {
1558 throw processException(e);
1559 }
1560 finally {
1561 closeSession(session);
1562 }
1563 }
1564
1565 public List<Object> findWithDynamicQuery(DynamicQuery dynamicQuery,
1566 int start, int end) throws SystemException {
1567 Session session = null;
1568
1569 try {
1570 session = openSession();
1571
1572 dynamicQuery.setLimit(start, end);
1573
1574 dynamicQuery.compile(session);
1575
1576 return dynamicQuery.list();
1577 }
1578 catch (Exception e) {
1579 throw processException(e);
1580 }
1581 finally {
1582 closeSession(session);
1583 }
1584 }
1585
1586 public List<UserGroupRole> findAll() throws SystemException {
1587 return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
1588 }
1589
1590 public List<UserGroupRole> findAll(int start, int end)
1591 throws SystemException {
1592 return findAll(start, end, null);
1593 }
1594
1595 public List<UserGroupRole> findAll(int start, int end, OrderByComparator obc)
1596 throws SystemException {
1597 Object[] finderArgs = new Object[] {
1598 String.valueOf(start), String.valueOf(end), String.valueOf(obc)
1599 };
1600
1601 List<UserGroupRole> list = (List<UserGroupRole>)FinderCacheUtil.getResult(FINDER_PATH_FIND_ALL,
1602 finderArgs, this);
1603
1604 if (list == null) {
1605 Session session = null;
1606
1607 try {
1608 session = openSession();
1609
1610 StringBundler query = null;
1611 String sql = null;
1612
1613 if (obc != null) {
1614 query = new StringBundler(2 +
1615 (obc.getOrderByFields().length * 3));
1616
1617 query.append(_SQL_SELECT_USERGROUPROLE);
1618
1619 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS, obc);
1620
1621 sql = query.toString();
1622 }
1623
1624 sql = _SQL_SELECT_USERGROUPROLE;
1625
1626 Query q = session.createQuery(sql);
1627
1628 if (obc == null) {
1629 list = (List<UserGroupRole>)QueryUtil.list(q, getDialect(),
1630 start, end, false);
1631
1632 Collections.sort(list);
1633 }
1634 else {
1635 list = (List<UserGroupRole>)QueryUtil.list(q, getDialect(),
1636 start, end);
1637 }
1638 }
1639 catch (Exception e) {
1640 throw processException(e);
1641 }
1642 finally {
1643 if (list == null) {
1644 list = new ArrayList<UserGroupRole>();
1645 }
1646
1647 cacheResult(list);
1648
1649 FinderCacheUtil.putResult(FINDER_PATH_FIND_ALL, finderArgs, list);
1650
1651 closeSession(session);
1652 }
1653 }
1654
1655 return list;
1656 }
1657
1658 public void removeByUserId(long userId) throws SystemException {
1659 for (UserGroupRole userGroupRole : findByUserId(userId)) {
1660 remove(userGroupRole);
1661 }
1662 }
1663
1664 public void removeByGroupId(long groupId) throws SystemException {
1665 for (UserGroupRole userGroupRole : findByGroupId(groupId)) {
1666 remove(userGroupRole);
1667 }
1668 }
1669
1670 public void removeByRoleId(long roleId) throws SystemException {
1671 for (UserGroupRole userGroupRole : findByRoleId(roleId)) {
1672 remove(userGroupRole);
1673 }
1674 }
1675
1676 public void removeByU_G(long userId, long groupId)
1677 throws SystemException {
1678 for (UserGroupRole userGroupRole : findByU_G(userId, groupId)) {
1679 remove(userGroupRole);
1680 }
1681 }
1682
1683 public void removeByG_R(long groupId, long roleId)
1684 throws SystemException {
1685 for (UserGroupRole userGroupRole : findByG_R(groupId, roleId)) {
1686 remove(userGroupRole);
1687 }
1688 }
1689
1690 public void removeAll() throws SystemException {
1691 for (UserGroupRole userGroupRole : findAll()) {
1692 remove(userGroupRole);
1693 }
1694 }
1695
1696 public int countByUserId(long userId) throws SystemException {
1697 Object[] finderArgs = new Object[] { new Long(userId) };
1698
1699 Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_USERID,
1700 finderArgs, this);
1701
1702 if (count == null) {
1703 Session session = null;
1704
1705 try {
1706 session = openSession();
1707
1708 StringBundler query = new StringBundler(2);
1709
1710 query.append(_SQL_COUNT_USERGROUPROLE_WHERE);
1711
1712 query.append(_FINDER_COLUMN_USERID_USERID_2);
1713
1714 String sql = query.toString();
1715
1716 Query q = session.createQuery(sql);
1717
1718 QueryPos qPos = QueryPos.getInstance(q);
1719
1720 qPos.add(userId);
1721
1722 count = (Long)q.uniqueResult();
1723 }
1724 catch (Exception e) {
1725 throw processException(e);
1726 }
1727 finally {
1728 if (count == null) {
1729 count = Long.valueOf(0);
1730 }
1731
1732 FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_USERID,
1733 finderArgs, count);
1734
1735 closeSession(session);
1736 }
1737 }
1738
1739 return count.intValue();
1740 }
1741
1742 public int countByGroupId(long groupId) throws SystemException {
1743 Object[] finderArgs = new Object[] { new Long(groupId) };
1744
1745 Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_GROUPID,
1746 finderArgs, this);
1747
1748 if (count == null) {
1749 Session session = null;
1750
1751 try {
1752 session = openSession();
1753
1754 StringBundler query = new StringBundler(2);
1755
1756 query.append(_SQL_COUNT_USERGROUPROLE_WHERE);
1757
1758 query.append(_FINDER_COLUMN_GROUPID_GROUPID_2);
1759
1760 String sql = query.toString();
1761
1762 Query q = session.createQuery(sql);
1763
1764 QueryPos qPos = QueryPos.getInstance(q);
1765
1766 qPos.add(groupId);
1767
1768 count = (Long)q.uniqueResult();
1769 }
1770 catch (Exception e) {
1771 throw processException(e);
1772 }
1773 finally {
1774 if (count == null) {
1775 count = Long.valueOf(0);
1776 }
1777
1778 FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_GROUPID,
1779 finderArgs, count);
1780
1781 closeSession(session);
1782 }
1783 }
1784
1785 return count.intValue();
1786 }
1787
1788 public int countByRoleId(long roleId) throws SystemException {
1789 Object[] finderArgs = new Object[] { new Long(roleId) };
1790
1791 Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_ROLEID,
1792 finderArgs, this);
1793
1794 if (count == null) {
1795 Session session = null;
1796
1797 try {
1798 session = openSession();
1799
1800 StringBundler query = new StringBundler(2);
1801
1802 query.append(_SQL_COUNT_USERGROUPROLE_WHERE);
1803
1804 query.append(_FINDER_COLUMN_ROLEID_ROLEID_2);
1805
1806 String sql = query.toString();
1807
1808 Query q = session.createQuery(sql);
1809
1810 QueryPos qPos = QueryPos.getInstance(q);
1811
1812 qPos.add(roleId);
1813
1814 count = (Long)q.uniqueResult();
1815 }
1816 catch (Exception e) {
1817 throw processException(e);
1818 }
1819 finally {
1820 if (count == null) {
1821 count = Long.valueOf(0);
1822 }
1823
1824 FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_ROLEID,
1825 finderArgs, count);
1826
1827 closeSession(session);
1828 }
1829 }
1830
1831 return count.intValue();
1832 }
1833
1834 public int countByU_G(long userId, long groupId) throws SystemException {
1835 Object[] finderArgs = new Object[] { new Long(userId), new Long(groupId) };
1836
1837 Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_U_G,
1838 finderArgs, this);
1839
1840 if (count == null) {
1841 Session session = null;
1842
1843 try {
1844 session = openSession();
1845
1846 StringBundler query = new StringBundler(3);
1847
1848 query.append(_SQL_COUNT_USERGROUPROLE_WHERE);
1849
1850 query.append(_FINDER_COLUMN_U_G_USERID_2);
1851
1852 query.append(_FINDER_COLUMN_U_G_GROUPID_2);
1853
1854 String sql = query.toString();
1855
1856 Query q = session.createQuery(sql);
1857
1858 QueryPos qPos = QueryPos.getInstance(q);
1859
1860 qPos.add(userId);
1861
1862 qPos.add(groupId);
1863
1864 count = (Long)q.uniqueResult();
1865 }
1866 catch (Exception e) {
1867 throw processException(e);
1868 }
1869 finally {
1870 if (count == null) {
1871 count = Long.valueOf(0);
1872 }
1873
1874 FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_U_G, finderArgs,
1875 count);
1876
1877 closeSession(session);
1878 }
1879 }
1880
1881 return count.intValue();
1882 }
1883
1884 public int countByG_R(long groupId, long roleId) throws SystemException {
1885 Object[] finderArgs = new Object[] { new Long(groupId), new Long(roleId) };
1886
1887 Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_G_R,
1888 finderArgs, this);
1889
1890 if (count == null) {
1891 Session session = null;
1892
1893 try {
1894 session = openSession();
1895
1896 StringBundler query = new StringBundler(3);
1897
1898 query.append(_SQL_COUNT_USERGROUPROLE_WHERE);
1899
1900 query.append(_FINDER_COLUMN_G_R_GROUPID_2);
1901
1902 query.append(_FINDER_COLUMN_G_R_ROLEID_2);
1903
1904 String sql = query.toString();
1905
1906 Query q = session.createQuery(sql);
1907
1908 QueryPos qPos = QueryPos.getInstance(q);
1909
1910 qPos.add(groupId);
1911
1912 qPos.add(roleId);
1913
1914 count = (Long)q.uniqueResult();
1915 }
1916 catch (Exception e) {
1917 throw processException(e);
1918 }
1919 finally {
1920 if (count == null) {
1921 count = Long.valueOf(0);
1922 }
1923
1924 FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_G_R, finderArgs,
1925 count);
1926
1927 closeSession(session);
1928 }
1929 }
1930
1931 return count.intValue();
1932 }
1933
1934 public int countAll() throws SystemException {
1935 Object[] finderArgs = new Object[0];
1936
1937 Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_ALL,
1938 finderArgs, this);
1939
1940 if (count == null) {
1941 Session session = null;
1942
1943 try {
1944 session = openSession();
1945
1946 Query q = session.createQuery(_SQL_COUNT_USERGROUPROLE);
1947
1948 count = (Long)q.uniqueResult();
1949 }
1950 catch (Exception e) {
1951 throw processException(e);
1952 }
1953 finally {
1954 if (count == null) {
1955 count = Long.valueOf(0);
1956 }
1957
1958 FinderCacheUtil.putResult(FINDER_PATH_COUNT_ALL, finderArgs,
1959 count);
1960
1961 closeSession(session);
1962 }
1963 }
1964
1965 return count.intValue();
1966 }
1967
1968 public void afterPropertiesSet() {
1969 String[] listenerClassNames = StringUtil.split(GetterUtil.getString(
1970 com.liferay.portal.util.PropsUtil.get(
1971 "value.object.listener.com.liferay.portal.model.UserGroupRole")));
1972
1973 if (listenerClassNames.length > 0) {
1974 try {
1975 List<ModelListener<UserGroupRole>> listenersList = new ArrayList<ModelListener<UserGroupRole>>();
1976
1977 for (String listenerClassName : listenerClassNames) {
1978 listenersList.add((ModelListener<UserGroupRole>)Class.forName(
1979 listenerClassName).newInstance());
1980 }
1981
1982 listeners = listenersList.toArray(new ModelListener[listenersList.size()]);
1983 }
1984 catch (Exception e) {
1985 _log.error(e);
1986 }
1987 }
1988 }
1989
1990 @BeanReference(name = "com.liferay.portal.service.persistence.AccountPersistence")
1991 protected com.liferay.portal.service.persistence.AccountPersistence accountPersistence;
1992 @BeanReference(name = "com.liferay.portal.service.persistence.AddressPersistence")
1993 protected com.liferay.portal.service.persistence.AddressPersistence addressPersistence;
1994 @BeanReference(name = "com.liferay.portal.service.persistence.BrowserTrackerPersistence")
1995 protected com.liferay.portal.service.persistence.BrowserTrackerPersistence browserTrackerPersistence;
1996 @BeanReference(name = "com.liferay.portal.service.persistence.ClassNamePersistence")
1997 protected com.liferay.portal.service.persistence.ClassNamePersistence classNamePersistence;
1998 @BeanReference(name = "com.liferay.portal.service.persistence.CompanyPersistence")
1999 protected com.liferay.portal.service.persistence.CompanyPersistence companyPersistence;
2000 @BeanReference(name = "com.liferay.portal.service.persistence.ContactPersistence")
2001 protected com.liferay.portal.service.persistence.ContactPersistence contactPersistence;
2002 @BeanReference(name = "com.liferay.portal.service.persistence.CountryPersistence")
2003 protected com.liferay.portal.service.persistence.CountryPersistence countryPersistence;
2004 @BeanReference(name = "com.liferay.portal.service.persistence.EmailAddressPersistence")
2005 protected com.liferay.portal.service.persistence.EmailAddressPersistence emailAddressPersistence;
2006 @BeanReference(name = "com.liferay.portal.service.persistence.GroupPersistence")
2007 protected com.liferay.portal.service.persistence.GroupPersistence groupPersistence;
2008 @BeanReference(name = "com.liferay.portal.service.persistence.ImagePersistence")
2009 protected com.liferay.portal.service.persistence.ImagePersistence imagePersistence;
2010 @BeanReference(name = "com.liferay.portal.service.persistence.LayoutPersistence")
2011 protected com.liferay.portal.service.persistence.LayoutPersistence layoutPersistence;
2012 @BeanReference(name = "com.liferay.portal.service.persistence.LayoutSetPersistence")
2013 protected com.liferay.portal.service.persistence.LayoutSetPersistence layoutSetPersistence;
2014 @BeanReference(name = "com.liferay.portal.service.persistence.ListTypePersistence")
2015 protected com.liferay.portal.service.persistence.ListTypePersistence listTypePersistence;
2016 @BeanReference(name = "com.liferay.portal.service.persistence.LockPersistence")
2017 protected com.liferay.portal.service.persistence.LockPersistence lockPersistence;
2018 @BeanReference(name = "com.liferay.portal.service.persistence.MembershipRequestPersistence")
2019 protected com.liferay.portal.service.persistence.MembershipRequestPersistence membershipRequestPersistence;
2020 @BeanReference(name = "com.liferay.portal.service.persistence.OrganizationPersistence")
2021 protected com.liferay.portal.service.persistence.OrganizationPersistence organizationPersistence;
2022 @BeanReference(name = "com.liferay.portal.service.persistence.OrgGroupPermissionPersistence")
2023 protected com.liferay.portal.service.persistence.OrgGroupPermissionPersistence orgGroupPermissionPersistence;
2024 @BeanReference(name = "com.liferay.portal.service.persistence.OrgGroupRolePersistence")
2025 protected com.liferay.portal.service.persistence.OrgGroupRolePersistence orgGroupRolePersistence;
2026 @BeanReference(name = "com.liferay.portal.service.persistence.OrgLaborPersistence")
2027 protected com.liferay.portal.service.persistence.OrgLaborPersistence orgLaborPersistence;
2028 @BeanReference(name = "com.liferay.portal.service.persistence.PasswordPolicyPersistence")
2029 protected com.liferay.portal.service.persistence.PasswordPolicyPersistence passwordPolicyPersistence;
2030 @BeanReference(name = "com.liferay.portal.service.persistence.PasswordPolicyRelPersistence")
2031 protected com.liferay.portal.service.persistence.PasswordPolicyRelPersistence passwordPolicyRelPersistence;
2032 @BeanReference(name = "com.liferay.portal.service.persistence.PasswordTrackerPersistence")
2033 protected com.liferay.portal.service.persistence.PasswordTrackerPersistence passwordTrackerPersistence;
2034 @BeanReference(name = "com.liferay.portal.service.persistence.PermissionPersistence")
2035 protected com.liferay.portal.service.persistence.PermissionPersistence permissionPersistence;
2036 @BeanReference(name = "com.liferay.portal.service.persistence.PhonePersistence")
2037 protected com.liferay.portal.service.persistence.PhonePersistence phonePersistence;
2038 @BeanReference(name = "com.liferay.portal.service.persistence.PluginSettingPersistence")
2039 protected com.liferay.portal.service.persistence.PluginSettingPersistence pluginSettingPersistence;
2040 @BeanReference(name = "com.liferay.portal.service.persistence.PortletPersistence")
2041 protected com.liferay.portal.service.persistence.PortletPersistence portletPersistence;
2042 @BeanReference(name = "com.liferay.portal.service.persistence.PortletItemPersistence")
2043 protected com.liferay.portal.service.persistence.PortletItemPersistence portletItemPersistence;
2044 @BeanReference(name = "com.liferay.portal.service.persistence.PortletPreferencesPersistence")
2045 protected com.liferay.portal.service.persistence.PortletPreferencesPersistence portletPreferencesPersistence;
2046 @BeanReference(name = "com.liferay.portal.service.persistence.RegionPersistence")
2047 protected com.liferay.portal.service.persistence.RegionPersistence regionPersistence;
2048 @BeanReference(name = "com.liferay.portal.service.persistence.ReleasePersistence")
2049 protected com.liferay.portal.service.persistence.ReleasePersistence releasePersistence;
2050 @BeanReference(name = "com.liferay.portal.service.persistence.ResourcePersistence")
2051 protected com.liferay.portal.service.persistence.ResourcePersistence resourcePersistence;
2052 @BeanReference(name = "com.liferay.portal.service.persistence.ResourceActionPersistence")
2053 protected com.liferay.portal.service.persistence.ResourceActionPersistence resourceActionPersistence;
2054 @BeanReference(name = "com.liferay.portal.service.persistence.ResourceCodePersistence")
2055 protected com.liferay.portal.service.persistence.ResourceCodePersistence resourceCodePersistence;
2056 @BeanReference(name = "com.liferay.portal.service.persistence.ResourcePermissionPersistence")
2057 protected com.liferay.portal.service.persistence.ResourcePermissionPersistence resourcePermissionPersistence;
2058 @BeanReference(name = "com.liferay.portal.service.persistence.RolePersistence")
2059 protected com.liferay.portal.service.persistence.RolePersistence rolePersistence;
2060 @BeanReference(name = "com.liferay.portal.service.persistence.ServiceComponentPersistence")
2061 protected com.liferay.portal.service.persistence.ServiceComponentPersistence serviceComponentPersistence;
2062 @BeanReference(name = "com.liferay.portal.service.persistence.ShardPersistence")
2063 protected com.liferay.portal.service.persistence.ShardPersistence shardPersistence;
2064 @BeanReference(name = "com.liferay.portal.service.persistence.SubscriptionPersistence")
2065 protected com.liferay.portal.service.persistence.SubscriptionPersistence subscriptionPersistence;
2066 @BeanReference(name = "com.liferay.portal.service.persistence.UserPersistence")
2067 protected com.liferay.portal.service.persistence.UserPersistence userPersistence;
2068 @BeanReference(name = "com.liferay.portal.service.persistence.UserGroupPersistence")
2069 protected com.liferay.portal.service.persistence.UserGroupPersistence userGroupPersistence;
2070 @BeanReference(name = "com.liferay.portal.service.persistence.UserGroupRolePersistence")
2071 protected com.liferay.portal.service.persistence.UserGroupRolePersistence userGroupRolePersistence;
2072 @BeanReference(name = "com.liferay.portal.service.persistence.UserIdMapperPersistence")
2073 protected com.liferay.portal.service.persistence.UserIdMapperPersistence userIdMapperPersistence;
2074 @BeanReference(name = "com.liferay.portal.service.persistence.UserTrackerPersistence")
2075 protected com.liferay.portal.service.persistence.UserTrackerPersistence userTrackerPersistence;
2076 @BeanReference(name = "com.liferay.portal.service.persistence.UserTrackerPathPersistence")
2077 protected com.liferay.portal.service.persistence.UserTrackerPathPersistence userTrackerPathPersistence;
2078 @BeanReference(name = "com.liferay.portal.service.persistence.WebDAVPropsPersistence")
2079 protected com.liferay.portal.service.persistence.WebDAVPropsPersistence webDAVPropsPersistence;
2080 @BeanReference(name = "com.liferay.portal.service.persistence.WebsitePersistence")
2081 protected com.liferay.portal.service.persistence.WebsitePersistence websitePersistence;
2082 private static final String _SQL_SELECT_USERGROUPROLE = "SELECT userGroupRole FROM UserGroupRole userGroupRole";
2083 private static final String _SQL_SELECT_USERGROUPROLE_WHERE = "SELECT userGroupRole FROM UserGroupRole userGroupRole WHERE ";
2084 private static final String _SQL_COUNT_USERGROUPROLE = "SELECT COUNT(userGroupRole) FROM UserGroupRole userGroupRole";
2085 private static final String _SQL_COUNT_USERGROUPROLE_WHERE = "SELECT COUNT(userGroupRole) FROM UserGroupRole userGroupRole WHERE ";
2086 private static final String _FINDER_COLUMN_USERID_USERID_2 = "userGroupRole.id.userId = ?";
2087 private static final String _FINDER_COLUMN_GROUPID_GROUPID_2 = "userGroupRole.id.groupId = ?";
2088 private static final String _FINDER_COLUMN_ROLEID_ROLEID_2 = "userGroupRole.id.roleId = ?";
2089 private static final String _FINDER_COLUMN_U_G_USERID_2 = "userGroupRole.id.userId = ? AND ";
2090 private static final String _FINDER_COLUMN_U_G_GROUPID_2 = "userGroupRole.id.groupId = ?";
2091 private static final String _FINDER_COLUMN_G_R_GROUPID_2 = "userGroupRole.id.groupId = ? AND ";
2092 private static final String _FINDER_COLUMN_G_R_ROLEID_2 = "userGroupRole.id.roleId = ?";
2093 private static final String _ORDER_BY_ENTITY_ALIAS = "userGroupRole.";
2094 private static final String _NO_SUCH_ENTITY_WITH_PRIMARY_KEY = "No UserGroupRole exists with the primary key ";
2095 private static final String _NO_SUCH_ENTITY_WITH_KEY = "No UserGroupRole exists with the key {";
2096 private static Log _log = LogFactoryUtil.getLog(UserGroupRolePersistenceImpl.class);
2097}