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