1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   *
12   * 
13   */
14  
15  package com.liferay.portal.service.persistence;
16  
17  import com.liferay.portal.NoSuchModelException;
18  import com.liferay.portal.NoSuchPasswordPolicyRelException;
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.PasswordPolicyRel;
38  import com.liferay.portal.model.impl.PasswordPolicyRelImpl;
39  import com.liferay.portal.model.impl.PasswordPolicyRelModelImpl;
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="PasswordPolicyRelPersistenceImpl.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       PasswordPolicyRelPersistence
58   * @see       PasswordPolicyRelUtil
59   * @generated
60   */
61  public class PasswordPolicyRelPersistenceImpl extends BasePersistenceImpl<PasswordPolicyRel>
62      implements PasswordPolicyRelPersistence {
63      public static final String FINDER_CLASS_NAME_ENTITY = PasswordPolicyRelImpl.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_PASSWORDPOLICYID = new FinderPath(PasswordPolicyRelModelImpl.ENTITY_CACHE_ENABLED,
67              PasswordPolicyRelModelImpl.FINDER_CACHE_ENABLED,
68              FINDER_CLASS_NAME_LIST, "findByPasswordPolicyId",
69              new String[] { Long.class.getName() });
70      public static final FinderPath FINDER_PATH_FIND_BY_OBC_PASSWORDPOLICYID = new FinderPath(PasswordPolicyRelModelImpl.ENTITY_CACHE_ENABLED,
71              PasswordPolicyRelModelImpl.FINDER_CACHE_ENABLED,
72              FINDER_CLASS_NAME_LIST, "findByPasswordPolicyId",
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_PASSWORDPOLICYID = new FinderPath(PasswordPolicyRelModelImpl.ENTITY_CACHE_ENABLED,
80              PasswordPolicyRelModelImpl.FINDER_CACHE_ENABLED,
81              FINDER_CLASS_NAME_LIST, "countByPasswordPolicyId",
82              new String[] { Long.class.getName() });
83      public static final FinderPath FINDER_PATH_FETCH_BY_C_C = new FinderPath(PasswordPolicyRelModelImpl.ENTITY_CACHE_ENABLED,
84              PasswordPolicyRelModelImpl.FINDER_CACHE_ENABLED,
85              FINDER_CLASS_NAME_ENTITY, "fetchByC_C",
86              new String[] { Long.class.getName(), Long.class.getName() });
87      public static final FinderPath FINDER_PATH_COUNT_BY_C_C = new FinderPath(PasswordPolicyRelModelImpl.ENTITY_CACHE_ENABLED,
88              PasswordPolicyRelModelImpl.FINDER_CACHE_ENABLED,
89              FINDER_CLASS_NAME_LIST, "countByC_C",
90              new String[] { Long.class.getName(), Long.class.getName() });
91      public static final FinderPath FINDER_PATH_FETCH_BY_P_C_C = new FinderPath(PasswordPolicyRelModelImpl.ENTITY_CACHE_ENABLED,
92              PasswordPolicyRelModelImpl.FINDER_CACHE_ENABLED,
93              FINDER_CLASS_NAME_ENTITY, "fetchByP_C_C",
94              new String[] {
95                  Long.class.getName(), Long.class.getName(), Long.class.getName()
96              });
97      public static final FinderPath FINDER_PATH_COUNT_BY_P_C_C = new FinderPath(PasswordPolicyRelModelImpl.ENTITY_CACHE_ENABLED,
98              PasswordPolicyRelModelImpl.FINDER_CACHE_ENABLED,
99              FINDER_CLASS_NAME_LIST, "countByP_C_C",
100             new String[] {
101                 Long.class.getName(), Long.class.getName(), Long.class.getName()
102             });
103     public static final FinderPath FINDER_PATH_FIND_ALL = new FinderPath(PasswordPolicyRelModelImpl.ENTITY_CACHE_ENABLED,
104             PasswordPolicyRelModelImpl.FINDER_CACHE_ENABLED,
105             FINDER_CLASS_NAME_LIST, "findAll", new String[0]);
106     public static final FinderPath FINDER_PATH_COUNT_ALL = new FinderPath(PasswordPolicyRelModelImpl.ENTITY_CACHE_ENABLED,
107             PasswordPolicyRelModelImpl.FINDER_CACHE_ENABLED,
108             FINDER_CLASS_NAME_LIST, "countAll", new String[0]);
109 
110     public void cacheResult(PasswordPolicyRel passwordPolicyRel) {
111         EntityCacheUtil.putResult(PasswordPolicyRelModelImpl.ENTITY_CACHE_ENABLED,
112             PasswordPolicyRelImpl.class, passwordPolicyRel.getPrimaryKey(),
113             passwordPolicyRel);
114 
115         FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_C_C,
116             new Object[] {
117                 new Long(passwordPolicyRel.getClassNameId()),
118                 new Long(passwordPolicyRel.getClassPK())
119             }, passwordPolicyRel);
120 
121         FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_P_C_C,
122             new Object[] {
123                 new Long(passwordPolicyRel.getPasswordPolicyId()),
124                 new Long(passwordPolicyRel.getClassNameId()),
125                 new Long(passwordPolicyRel.getClassPK())
126             }, passwordPolicyRel);
127     }
128 
129     public void cacheResult(List<PasswordPolicyRel> passwordPolicyRels) {
130         for (PasswordPolicyRel passwordPolicyRel : passwordPolicyRels) {
131             if (EntityCacheUtil.getResult(
132                         PasswordPolicyRelModelImpl.ENTITY_CACHE_ENABLED,
133                         PasswordPolicyRelImpl.class,
134                         passwordPolicyRel.getPrimaryKey(), this) == null) {
135                 cacheResult(passwordPolicyRel);
136             }
137         }
138     }
139 
140     public void clearCache() {
141         CacheRegistry.clear(PasswordPolicyRelImpl.class.getName());
142         EntityCacheUtil.clearCache(PasswordPolicyRelImpl.class.getName());
143         FinderCacheUtil.clearCache(FINDER_CLASS_NAME_ENTITY);
144         FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST);
145     }
146 
147     public PasswordPolicyRel create(long passwordPolicyRelId) {
148         PasswordPolicyRel passwordPolicyRel = new PasswordPolicyRelImpl();
149 
150         passwordPolicyRel.setNew(true);
151         passwordPolicyRel.setPrimaryKey(passwordPolicyRelId);
152 
153         return passwordPolicyRel;
154     }
155 
156     public PasswordPolicyRel remove(Serializable primaryKey)
157         throws NoSuchModelException, SystemException {
158         return remove(((Long)primaryKey).longValue());
159     }
160 
161     public PasswordPolicyRel remove(long passwordPolicyRelId)
162         throws NoSuchPasswordPolicyRelException, SystemException {
163         Session session = null;
164 
165         try {
166             session = openSession();
167 
168             PasswordPolicyRel passwordPolicyRel = (PasswordPolicyRel)session.get(PasswordPolicyRelImpl.class,
169                     new Long(passwordPolicyRelId));
170 
171             if (passwordPolicyRel == null) {
172                 if (_log.isWarnEnabled()) {
173                     _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
174                         passwordPolicyRelId);
175                 }
176 
177                 throw new NoSuchPasswordPolicyRelException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
178                     passwordPolicyRelId);
179             }
180 
181             return remove(passwordPolicyRel);
182         }
183         catch (NoSuchPasswordPolicyRelException nsee) {
184             throw nsee;
185         }
186         catch (Exception e) {
187             throw processException(e);
188         }
189         finally {
190             closeSession(session);
191         }
192     }
193 
194     public PasswordPolicyRel remove(PasswordPolicyRel passwordPolicyRel)
195         throws SystemException {
196         for (ModelListener<PasswordPolicyRel> listener : listeners) {
197             listener.onBeforeRemove(passwordPolicyRel);
198         }
199 
200         passwordPolicyRel = removeImpl(passwordPolicyRel);
201 
202         for (ModelListener<PasswordPolicyRel> listener : listeners) {
203             listener.onAfterRemove(passwordPolicyRel);
204         }
205 
206         return passwordPolicyRel;
207     }
208 
209     protected PasswordPolicyRel removeImpl(PasswordPolicyRel passwordPolicyRel)
210         throws SystemException {
211         passwordPolicyRel = toUnwrappedModel(passwordPolicyRel);
212 
213         Session session = null;
214 
215         try {
216             session = openSession();
217 
218             if (passwordPolicyRel.isCachedModel() ||
219                     BatchSessionUtil.isEnabled()) {
220                 Object staleObject = session.get(PasswordPolicyRelImpl.class,
221                         passwordPolicyRel.getPrimaryKeyObj());
222 
223                 if (staleObject != null) {
224                     session.evict(staleObject);
225                 }
226             }
227 
228             session.delete(passwordPolicyRel);
229 
230             session.flush();
231         }
232         catch (Exception e) {
233             throw processException(e);
234         }
235         finally {
236             closeSession(session);
237         }
238 
239         FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST);
240 
241         PasswordPolicyRelModelImpl passwordPolicyRelModelImpl = (PasswordPolicyRelModelImpl)passwordPolicyRel;
242 
243         FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_C_C,
244             new Object[] {
245                 new Long(passwordPolicyRelModelImpl.getOriginalClassNameId()),
246                 new Long(passwordPolicyRelModelImpl.getOriginalClassPK())
247             });
248 
249         FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_P_C_C,
250             new Object[] {
251                 new Long(passwordPolicyRelModelImpl.getOriginalPasswordPolicyId()),
252                 new Long(passwordPolicyRelModelImpl.getOriginalClassNameId()),
253                 new Long(passwordPolicyRelModelImpl.getOriginalClassPK())
254             });
255 
256         EntityCacheUtil.removeResult(PasswordPolicyRelModelImpl.ENTITY_CACHE_ENABLED,
257             PasswordPolicyRelImpl.class, passwordPolicyRel.getPrimaryKey());
258 
259         return passwordPolicyRel;
260     }
261 
262     /**
263      * @deprecated Use {@link BasePersistence#update(com.liferay.portal.model.BaseModel, boolean)}.
264      */
265     public PasswordPolicyRel update(PasswordPolicyRel passwordPolicyRel)
266         throws SystemException {
267         if (_log.isWarnEnabled()) {
268             _log.warn(
269                 "Using the deprecated update(PasswordPolicyRel passwordPolicyRel) method. Use update(PasswordPolicyRel passwordPolicyRel, boolean merge) instead.");
270         }
271 
272         return update(passwordPolicyRel, false);
273     }
274 
275     public PasswordPolicyRel updateImpl(
276         com.liferay.portal.model.PasswordPolicyRel passwordPolicyRel,
277         boolean merge) throws SystemException {
278         passwordPolicyRel = toUnwrappedModel(passwordPolicyRel);
279 
280         boolean isNew = passwordPolicyRel.isNew();
281 
282         PasswordPolicyRelModelImpl passwordPolicyRelModelImpl = (PasswordPolicyRelModelImpl)passwordPolicyRel;
283 
284         Session session = null;
285 
286         try {
287             session = openSession();
288 
289             BatchSessionUtil.update(session, passwordPolicyRel, merge);
290 
291             passwordPolicyRel.setNew(false);
292         }
293         catch (Exception e) {
294             throw processException(e);
295         }
296         finally {
297             closeSession(session);
298         }
299 
300         FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST);
301 
302         EntityCacheUtil.putResult(PasswordPolicyRelModelImpl.ENTITY_CACHE_ENABLED,
303             PasswordPolicyRelImpl.class, passwordPolicyRel.getPrimaryKey(),
304             passwordPolicyRel);
305 
306         if (!isNew &&
307                 ((passwordPolicyRel.getClassNameId() != passwordPolicyRelModelImpl.getOriginalClassNameId()) ||
308                 (passwordPolicyRel.getClassPK() != passwordPolicyRelModelImpl.getOriginalClassPK()))) {
309             FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_C_C,
310                 new Object[] {
311                     new Long(passwordPolicyRelModelImpl.getOriginalClassNameId()),
312                     new Long(passwordPolicyRelModelImpl.getOriginalClassPK())
313                 });
314         }
315 
316         if (isNew ||
317                 ((passwordPolicyRel.getClassNameId() != passwordPolicyRelModelImpl.getOriginalClassNameId()) ||
318                 (passwordPolicyRel.getClassPK() != passwordPolicyRelModelImpl.getOriginalClassPK()))) {
319             FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_C_C,
320                 new Object[] {
321                     new Long(passwordPolicyRel.getClassNameId()),
322                     new Long(passwordPolicyRel.getClassPK())
323                 }, passwordPolicyRel);
324         }
325 
326         if (!isNew &&
327                 ((passwordPolicyRel.getPasswordPolicyId() != passwordPolicyRelModelImpl.getOriginalPasswordPolicyId()) ||
328                 (passwordPolicyRel.getClassNameId() != passwordPolicyRelModelImpl.getOriginalClassNameId()) ||
329                 (passwordPolicyRel.getClassPK() != passwordPolicyRelModelImpl.getOriginalClassPK()))) {
330             FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_P_C_C,
331                 new Object[] {
332                     new Long(passwordPolicyRelModelImpl.getOriginalPasswordPolicyId()),
333                     new Long(passwordPolicyRelModelImpl.getOriginalClassNameId()),
334                     new Long(passwordPolicyRelModelImpl.getOriginalClassPK())
335                 });
336         }
337 
338         if (isNew ||
339                 ((passwordPolicyRel.getPasswordPolicyId() != passwordPolicyRelModelImpl.getOriginalPasswordPolicyId()) ||
340                 (passwordPolicyRel.getClassNameId() != passwordPolicyRelModelImpl.getOriginalClassNameId()) ||
341                 (passwordPolicyRel.getClassPK() != passwordPolicyRelModelImpl.getOriginalClassPK()))) {
342             FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_P_C_C,
343                 new Object[] {
344                     new Long(passwordPolicyRel.getPasswordPolicyId()),
345                     new Long(passwordPolicyRel.getClassNameId()),
346                     new Long(passwordPolicyRel.getClassPK())
347                 }, passwordPolicyRel);
348         }
349 
350         return passwordPolicyRel;
351     }
352 
353     protected PasswordPolicyRel toUnwrappedModel(
354         PasswordPolicyRel passwordPolicyRel) {
355         if (passwordPolicyRel instanceof PasswordPolicyRelImpl) {
356             return passwordPolicyRel;
357         }
358 
359         PasswordPolicyRelImpl passwordPolicyRelImpl = new PasswordPolicyRelImpl();
360 
361         passwordPolicyRelImpl.setNew(passwordPolicyRel.isNew());
362         passwordPolicyRelImpl.setPrimaryKey(passwordPolicyRel.getPrimaryKey());
363 
364         passwordPolicyRelImpl.setPasswordPolicyRelId(passwordPolicyRel.getPasswordPolicyRelId());
365         passwordPolicyRelImpl.setPasswordPolicyId(passwordPolicyRel.getPasswordPolicyId());
366         passwordPolicyRelImpl.setClassNameId(passwordPolicyRel.getClassNameId());
367         passwordPolicyRelImpl.setClassPK(passwordPolicyRel.getClassPK());
368 
369         return passwordPolicyRelImpl;
370     }
371 
372     public PasswordPolicyRel findByPrimaryKey(Serializable primaryKey)
373         throws NoSuchModelException, SystemException {
374         return findByPrimaryKey(((Long)primaryKey).longValue());
375     }
376 
377     public PasswordPolicyRel findByPrimaryKey(long passwordPolicyRelId)
378         throws NoSuchPasswordPolicyRelException, SystemException {
379         PasswordPolicyRel passwordPolicyRel = fetchByPrimaryKey(passwordPolicyRelId);
380 
381         if (passwordPolicyRel == null) {
382             if (_log.isWarnEnabled()) {
383                 _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
384                     passwordPolicyRelId);
385             }
386 
387             throw new NoSuchPasswordPolicyRelException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
388                 passwordPolicyRelId);
389         }
390 
391         return passwordPolicyRel;
392     }
393 
394     public PasswordPolicyRel fetchByPrimaryKey(Serializable primaryKey)
395         throws SystemException {
396         return fetchByPrimaryKey(((Long)primaryKey).longValue());
397     }
398 
399     public PasswordPolicyRel fetchByPrimaryKey(long passwordPolicyRelId)
400         throws SystemException {
401         PasswordPolicyRel passwordPolicyRel = (PasswordPolicyRel)EntityCacheUtil.getResult(PasswordPolicyRelModelImpl.ENTITY_CACHE_ENABLED,
402                 PasswordPolicyRelImpl.class, passwordPolicyRelId, this);
403 
404         if (passwordPolicyRel == null) {
405             Session session = null;
406 
407             try {
408                 session = openSession();
409 
410                 passwordPolicyRel = (PasswordPolicyRel)session.get(PasswordPolicyRelImpl.class,
411                         new Long(passwordPolicyRelId));
412             }
413             catch (Exception e) {
414                 throw processException(e);
415             }
416             finally {
417                 if (passwordPolicyRel != null) {
418                     cacheResult(passwordPolicyRel);
419                 }
420 
421                 closeSession(session);
422             }
423         }
424 
425         return passwordPolicyRel;
426     }
427 
428     public List<PasswordPolicyRel> findByPasswordPolicyId(long passwordPolicyId)
429         throws SystemException {
430         Object[] finderArgs = new Object[] { new Long(passwordPolicyId) };
431 
432         List<PasswordPolicyRel> list = (List<PasswordPolicyRel>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_PASSWORDPOLICYID,
433                 finderArgs, this);
434 
435         if (list == null) {
436             Session session = null;
437 
438             try {
439                 session = openSession();
440 
441                 StringBundler query = new StringBundler(2);
442 
443                 query.append(_SQL_SELECT_PASSWORDPOLICYREL_WHERE);
444 
445                 query.append(_FINDER_COLUMN_PASSWORDPOLICYID_PASSWORDPOLICYID_2);
446 
447                 String sql = query.toString();
448 
449                 Query q = session.createQuery(sql);
450 
451                 QueryPos qPos = QueryPos.getInstance(q);
452 
453                 qPos.add(passwordPolicyId);
454 
455                 list = q.list();
456             }
457             catch (Exception e) {
458                 throw processException(e);
459             }
460             finally {
461                 if (list == null) {
462                     list = new ArrayList<PasswordPolicyRel>();
463                 }
464 
465                 cacheResult(list);
466 
467                 FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_PASSWORDPOLICYID,
468                     finderArgs, list);
469 
470                 closeSession(session);
471             }
472         }
473 
474         return list;
475     }
476 
477     public List<PasswordPolicyRel> findByPasswordPolicyId(
478         long passwordPolicyId, int start, int end) throws SystemException {
479         return findByPasswordPolicyId(passwordPolicyId, start, end, null);
480     }
481 
482     public List<PasswordPolicyRel> findByPasswordPolicyId(
483         long passwordPolicyId, int start, int end,
484         OrderByComparator orderByComparator) throws SystemException {
485         Object[] finderArgs = new Object[] {
486                 new Long(passwordPolicyId),
487                 
488                 String.valueOf(start), String.valueOf(end),
489                 String.valueOf(orderByComparator)
490             };
491 
492         List<PasswordPolicyRel> list = (List<PasswordPolicyRel>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_OBC_PASSWORDPOLICYID,
493                 finderArgs, this);
494 
495         if (list == null) {
496             Session session = null;
497 
498             try {
499                 session = openSession();
500 
501                 StringBundler query = null;
502 
503                 if (orderByComparator != null) {
504                     query = new StringBundler(3 +
505                             (orderByComparator.getOrderByFields().length * 3));
506                 }
507                 else {
508                     query = new StringBundler(2);
509                 }
510 
511                 query.append(_SQL_SELECT_PASSWORDPOLICYREL_WHERE);
512 
513                 query.append(_FINDER_COLUMN_PASSWORDPOLICYID_PASSWORDPOLICYID_2);
514 
515                 if (orderByComparator != null) {
516                     appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
517                         orderByComparator);
518                 }
519 
520                 String sql = query.toString();
521 
522                 Query q = session.createQuery(sql);
523 
524                 QueryPos qPos = QueryPos.getInstance(q);
525 
526                 qPos.add(passwordPolicyId);
527 
528                 list = (List<PasswordPolicyRel>)QueryUtil.list(q, getDialect(),
529                         start, end);
530             }
531             catch (Exception e) {
532                 throw processException(e);
533             }
534             finally {
535                 if (list == null) {
536                     list = new ArrayList<PasswordPolicyRel>();
537                 }
538 
539                 cacheResult(list);
540 
541                 FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_OBC_PASSWORDPOLICYID,
542                     finderArgs, list);
543 
544                 closeSession(session);
545             }
546         }
547 
548         return list;
549     }
550 
551     public PasswordPolicyRel findByPasswordPolicyId_First(
552         long passwordPolicyId, OrderByComparator orderByComparator)
553         throws NoSuchPasswordPolicyRelException, SystemException {
554         List<PasswordPolicyRel> list = findByPasswordPolicyId(passwordPolicyId,
555                 0, 1, orderByComparator);
556 
557         if (list.isEmpty()) {
558             StringBundler msg = new StringBundler(4);
559 
560             msg.append(_NO_SUCH_ENTITY_WITH_KEY);
561 
562             msg.append("passwordPolicyId=");
563             msg.append(passwordPolicyId);
564 
565             msg.append(StringPool.CLOSE_CURLY_BRACE);
566 
567             throw new NoSuchPasswordPolicyRelException(msg.toString());
568         }
569         else {
570             return list.get(0);
571         }
572     }
573 
574     public PasswordPolicyRel findByPasswordPolicyId_Last(
575         long passwordPolicyId, OrderByComparator orderByComparator)
576         throws NoSuchPasswordPolicyRelException, SystemException {
577         int count = countByPasswordPolicyId(passwordPolicyId);
578 
579         List<PasswordPolicyRel> list = findByPasswordPolicyId(passwordPolicyId,
580                 count - 1, count, orderByComparator);
581 
582         if (list.isEmpty()) {
583             StringBundler msg = new StringBundler(4);
584 
585             msg.append(_NO_SUCH_ENTITY_WITH_KEY);
586 
587             msg.append("passwordPolicyId=");
588             msg.append(passwordPolicyId);
589 
590             msg.append(StringPool.CLOSE_CURLY_BRACE);
591 
592             throw new NoSuchPasswordPolicyRelException(msg.toString());
593         }
594         else {
595             return list.get(0);
596         }
597     }
598 
599     public PasswordPolicyRel[] findByPasswordPolicyId_PrevAndNext(
600         long passwordPolicyRelId, long passwordPolicyId,
601         OrderByComparator orderByComparator)
602         throws NoSuchPasswordPolicyRelException, SystemException {
603         PasswordPolicyRel passwordPolicyRel = findByPrimaryKey(passwordPolicyRelId);
604 
605         int count = countByPasswordPolicyId(passwordPolicyId);
606 
607         Session session = null;
608 
609         try {
610             session = openSession();
611 
612             StringBundler query = null;
613 
614             if (orderByComparator != null) {
615                 query = new StringBundler(3 +
616                         (orderByComparator.getOrderByFields().length * 3));
617             }
618             else {
619                 query = new StringBundler(2);
620             }
621 
622             query.append(_SQL_SELECT_PASSWORDPOLICYREL_WHERE);
623 
624             query.append(_FINDER_COLUMN_PASSWORDPOLICYID_PASSWORDPOLICYID_2);
625 
626             if (orderByComparator != null) {
627                 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
628                     orderByComparator);
629             }
630 
631             String sql = query.toString();
632 
633             Query q = session.createQuery(sql);
634 
635             QueryPos qPos = QueryPos.getInstance(q);
636 
637             qPos.add(passwordPolicyId);
638 
639             Object[] objArray = QueryUtil.getPrevAndNext(q, count,
640                     orderByComparator, passwordPolicyRel);
641 
642             PasswordPolicyRel[] array = new PasswordPolicyRelImpl[3];
643 
644             array[0] = (PasswordPolicyRel)objArray[0];
645             array[1] = (PasswordPolicyRel)objArray[1];
646             array[2] = (PasswordPolicyRel)objArray[2];
647 
648             return array;
649         }
650         catch (Exception e) {
651             throw processException(e);
652         }
653         finally {
654             closeSession(session);
655         }
656     }
657 
658     public PasswordPolicyRel findByC_C(long classNameId, long classPK)
659         throws NoSuchPasswordPolicyRelException, SystemException {
660         PasswordPolicyRel passwordPolicyRel = fetchByC_C(classNameId, classPK);
661 
662         if (passwordPolicyRel == null) {
663             StringBundler msg = new StringBundler(6);
664 
665             msg.append(_NO_SUCH_ENTITY_WITH_KEY);
666 
667             msg.append("classNameId=");
668             msg.append(classNameId);
669 
670             msg.append(", classPK=");
671             msg.append(classPK);
672 
673             msg.append(StringPool.CLOSE_CURLY_BRACE);
674 
675             if (_log.isWarnEnabled()) {
676                 _log.warn(msg.toString());
677             }
678 
679             throw new NoSuchPasswordPolicyRelException(msg.toString());
680         }
681 
682         return passwordPolicyRel;
683     }
684 
685     public PasswordPolicyRel fetchByC_C(long classNameId, long classPK)
686         throws SystemException {
687         return fetchByC_C(classNameId, classPK, true);
688     }
689 
690     public PasswordPolicyRel fetchByC_C(long classNameId, long classPK,
691         boolean retrieveFromCache) throws SystemException {
692         Object[] finderArgs = new Object[] {
693                 new Long(classNameId), new Long(classPK)
694             };
695 
696         Object result = null;
697 
698         if (retrieveFromCache) {
699             result = FinderCacheUtil.getResult(FINDER_PATH_FETCH_BY_C_C,
700                     finderArgs, this);
701         }
702 
703         if (result == null) {
704             Session session = null;
705 
706             try {
707                 session = openSession();
708 
709                 StringBundler query = new StringBundler(3);
710 
711                 query.append(_SQL_SELECT_PASSWORDPOLICYREL_WHERE);
712 
713                 query.append(_FINDER_COLUMN_C_C_CLASSNAMEID_2);
714 
715                 query.append(_FINDER_COLUMN_C_C_CLASSPK_2);
716 
717                 String sql = query.toString();
718 
719                 Query q = session.createQuery(sql);
720 
721                 QueryPos qPos = QueryPos.getInstance(q);
722 
723                 qPos.add(classNameId);
724 
725                 qPos.add(classPK);
726 
727                 List<PasswordPolicyRel> list = q.list();
728 
729                 result = list;
730 
731                 PasswordPolicyRel passwordPolicyRel = null;
732 
733                 if (list.isEmpty()) {
734                     FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_C_C,
735                         finderArgs, list);
736                 }
737                 else {
738                     passwordPolicyRel = list.get(0);
739 
740                     cacheResult(passwordPolicyRel);
741 
742                     if ((passwordPolicyRel.getClassNameId() != classNameId) ||
743                             (passwordPolicyRel.getClassPK() != classPK)) {
744                         FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_C_C,
745                             finderArgs, passwordPolicyRel);
746                     }
747                 }
748 
749                 return passwordPolicyRel;
750             }
751             catch (Exception e) {
752                 throw processException(e);
753             }
754             finally {
755                 if (result == null) {
756                     FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_C_C,
757                         finderArgs, new ArrayList<PasswordPolicyRel>());
758                 }
759 
760                 closeSession(session);
761             }
762         }
763         else {
764             if (result instanceof List<?>) {
765                 return null;
766             }
767             else {
768                 return (PasswordPolicyRel)result;
769             }
770         }
771     }
772 
773     public PasswordPolicyRel findByP_C_C(long passwordPolicyId,
774         long classNameId, long classPK)
775         throws NoSuchPasswordPolicyRelException, SystemException {
776         PasswordPolicyRel passwordPolicyRel = fetchByP_C_C(passwordPolicyId,
777                 classNameId, classPK);
778 
779         if (passwordPolicyRel == null) {
780             StringBundler msg = new StringBundler(8);
781 
782             msg.append(_NO_SUCH_ENTITY_WITH_KEY);
783 
784             msg.append("passwordPolicyId=");
785             msg.append(passwordPolicyId);
786 
787             msg.append(", classNameId=");
788             msg.append(classNameId);
789 
790             msg.append(", classPK=");
791             msg.append(classPK);
792 
793             msg.append(StringPool.CLOSE_CURLY_BRACE);
794 
795             if (_log.isWarnEnabled()) {
796                 _log.warn(msg.toString());
797             }
798 
799             throw new NoSuchPasswordPolicyRelException(msg.toString());
800         }
801 
802         return passwordPolicyRel;
803     }
804 
805     public PasswordPolicyRel fetchByP_C_C(long passwordPolicyId,
806         long classNameId, long classPK) throws SystemException {
807         return fetchByP_C_C(passwordPolicyId, classNameId, classPK, true);
808     }
809 
810     public PasswordPolicyRel fetchByP_C_C(long passwordPolicyId,
811         long classNameId, long classPK, boolean retrieveFromCache)
812         throws SystemException {
813         Object[] finderArgs = new Object[] {
814                 new Long(passwordPolicyId), new Long(classNameId),
815                 new Long(classPK)
816             };
817 
818         Object result = null;
819 
820         if (retrieveFromCache) {
821             result = FinderCacheUtil.getResult(FINDER_PATH_FETCH_BY_P_C_C,
822                     finderArgs, this);
823         }
824 
825         if (result == null) {
826             Session session = null;
827 
828             try {
829                 session = openSession();
830 
831                 StringBundler query = new StringBundler(4);
832 
833                 query.append(_SQL_SELECT_PASSWORDPOLICYREL_WHERE);
834 
835                 query.append(_FINDER_COLUMN_P_C_C_PASSWORDPOLICYID_2);
836 
837                 query.append(_FINDER_COLUMN_P_C_C_CLASSNAMEID_2);
838 
839                 query.append(_FINDER_COLUMN_P_C_C_CLASSPK_2);
840 
841                 String sql = query.toString();
842 
843                 Query q = session.createQuery(sql);
844 
845                 QueryPos qPos = QueryPos.getInstance(q);
846 
847                 qPos.add(passwordPolicyId);
848 
849                 qPos.add(classNameId);
850 
851                 qPos.add(classPK);
852 
853                 List<PasswordPolicyRel> list = q.list();
854 
855                 result = list;
856 
857                 PasswordPolicyRel passwordPolicyRel = null;
858 
859                 if (list.isEmpty()) {
860                     FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_P_C_C,
861                         finderArgs, list);
862                 }
863                 else {
864                     passwordPolicyRel = list.get(0);
865 
866                     cacheResult(passwordPolicyRel);
867 
868                     if ((passwordPolicyRel.getPasswordPolicyId() != passwordPolicyId) ||
869                             (passwordPolicyRel.getClassNameId() != classNameId) ||
870                             (passwordPolicyRel.getClassPK() != classPK)) {
871                         FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_P_C_C,
872                             finderArgs, passwordPolicyRel);
873                     }
874                 }
875 
876                 return passwordPolicyRel;
877             }
878             catch (Exception e) {
879                 throw processException(e);
880             }
881             finally {
882                 if (result == null) {
883                     FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_P_C_C,
884                         finderArgs, new ArrayList<PasswordPolicyRel>());
885                 }
886 
887                 closeSession(session);
888             }
889         }
890         else {
891             if (result instanceof List<?>) {
892                 return null;
893             }
894             else {
895                 return (PasswordPolicyRel)result;
896             }
897         }
898     }
899 
900     public List<PasswordPolicyRel> findAll() throws SystemException {
901         return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
902     }
903 
904     public List<PasswordPolicyRel> findAll(int start, int end)
905         throws SystemException {
906         return findAll(start, end, null);
907     }
908 
909     public List<PasswordPolicyRel> findAll(int start, int end,
910         OrderByComparator orderByComparator) throws SystemException {
911         Object[] finderArgs = new Object[] {
912                 String.valueOf(start), String.valueOf(end),
913                 String.valueOf(orderByComparator)
914             };
915 
916         List<PasswordPolicyRel> list = (List<PasswordPolicyRel>)FinderCacheUtil.getResult(FINDER_PATH_FIND_ALL,
917                 finderArgs, this);
918 
919         if (list == null) {
920             Session session = null;
921 
922             try {
923                 session = openSession();
924 
925                 StringBundler query = null;
926                 String sql = null;
927 
928                 if (orderByComparator != null) {
929                     query = new StringBundler(2 +
930                             (orderByComparator.getOrderByFields().length * 3));
931 
932                     query.append(_SQL_SELECT_PASSWORDPOLICYREL);
933 
934                     appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
935                         orderByComparator);
936 
937                     sql = query.toString();
938                 }
939 
940                 sql = _SQL_SELECT_PASSWORDPOLICYREL;
941 
942                 Query q = session.createQuery(sql);
943 
944                 if (orderByComparator == null) {
945                     list = (List<PasswordPolicyRel>)QueryUtil.list(q,
946                             getDialect(), start, end, false);
947 
948                     Collections.sort(list);
949                 }
950                 else {
951                     list = (List<PasswordPolicyRel>)QueryUtil.list(q,
952                             getDialect(), start, end);
953                 }
954             }
955             catch (Exception e) {
956                 throw processException(e);
957             }
958             finally {
959                 if (list == null) {
960                     list = new ArrayList<PasswordPolicyRel>();
961                 }
962 
963                 cacheResult(list);
964 
965                 FinderCacheUtil.putResult(FINDER_PATH_FIND_ALL, finderArgs, list);
966 
967                 closeSession(session);
968             }
969         }
970 
971         return list;
972     }
973 
974     public void removeByPasswordPolicyId(long passwordPolicyId)
975         throws SystemException {
976         for (PasswordPolicyRel passwordPolicyRel : findByPasswordPolicyId(
977                 passwordPolicyId)) {
978             remove(passwordPolicyRel);
979         }
980     }
981 
982     public void removeByC_C(long classNameId, long classPK)
983         throws NoSuchPasswordPolicyRelException, SystemException {
984         PasswordPolicyRel passwordPolicyRel = findByC_C(classNameId, classPK);
985 
986         remove(passwordPolicyRel);
987     }
988 
989     public void removeByP_C_C(long passwordPolicyId, long classNameId,
990         long classPK) throws NoSuchPasswordPolicyRelException, SystemException {
991         PasswordPolicyRel passwordPolicyRel = findByP_C_C(passwordPolicyId,
992                 classNameId, classPK);
993 
994         remove(passwordPolicyRel);
995     }
996 
997     public void removeAll() throws SystemException {
998         for (PasswordPolicyRel passwordPolicyRel : findAll()) {
999             remove(passwordPolicyRel);
1000        }
1001    }
1002
1003    public int countByPasswordPolicyId(long passwordPolicyId)
1004        throws SystemException {
1005        Object[] finderArgs = new Object[] { new Long(passwordPolicyId) };
1006
1007        Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_PASSWORDPOLICYID,
1008                finderArgs, this);
1009
1010        if (count == null) {
1011            Session session = null;
1012
1013            try {
1014                session = openSession();
1015
1016                StringBundler query = new StringBundler(2);
1017
1018                query.append(_SQL_COUNT_PASSWORDPOLICYREL_WHERE);
1019
1020                query.append(_FINDER_COLUMN_PASSWORDPOLICYID_PASSWORDPOLICYID_2);
1021
1022                String sql = query.toString();
1023
1024                Query q = session.createQuery(sql);
1025
1026                QueryPos qPos = QueryPos.getInstance(q);
1027
1028                qPos.add(passwordPolicyId);
1029
1030                count = (Long)q.uniqueResult();
1031            }
1032            catch (Exception e) {
1033                throw processException(e);
1034            }
1035            finally {
1036                if (count == null) {
1037                    count = Long.valueOf(0);
1038                }
1039
1040                FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_PASSWORDPOLICYID,
1041                    finderArgs, count);
1042
1043                closeSession(session);
1044            }
1045        }
1046
1047        return count.intValue();
1048    }
1049
1050    public int countByC_C(long classNameId, long classPK)
1051        throws SystemException {
1052        Object[] finderArgs = new Object[] {
1053                new Long(classNameId), new Long(classPK)
1054            };
1055
1056        Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_C_C,
1057                finderArgs, this);
1058
1059        if (count == null) {
1060            Session session = null;
1061
1062            try {
1063                session = openSession();
1064
1065                StringBundler query = new StringBundler(3);
1066
1067                query.append(_SQL_COUNT_PASSWORDPOLICYREL_WHERE);
1068
1069                query.append(_FINDER_COLUMN_C_C_CLASSNAMEID_2);
1070
1071                query.append(_FINDER_COLUMN_C_C_CLASSPK_2);
1072
1073                String sql = query.toString();
1074
1075                Query q = session.createQuery(sql);
1076
1077                QueryPos qPos = QueryPos.getInstance(q);
1078
1079                qPos.add(classNameId);
1080
1081                qPos.add(classPK);
1082
1083                count = (Long)q.uniqueResult();
1084            }
1085            catch (Exception e) {
1086                throw processException(e);
1087            }
1088            finally {
1089                if (count == null) {
1090                    count = Long.valueOf(0);
1091                }
1092
1093                FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_C_C, finderArgs,
1094                    count);
1095
1096                closeSession(session);
1097            }
1098        }
1099
1100        return count.intValue();
1101    }
1102
1103    public int countByP_C_C(long passwordPolicyId, long classNameId,
1104        long classPK) throws SystemException {
1105        Object[] finderArgs = new Object[] {
1106                new Long(passwordPolicyId), new Long(classNameId),
1107                new Long(classPK)
1108            };
1109
1110        Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_P_C_C,
1111                finderArgs, this);
1112
1113        if (count == null) {
1114            Session session = null;
1115
1116            try {
1117                session = openSession();
1118
1119                StringBundler query = new StringBundler(4);
1120
1121                query.append(_SQL_COUNT_PASSWORDPOLICYREL_WHERE);
1122
1123                query.append(_FINDER_COLUMN_P_C_C_PASSWORDPOLICYID_2);
1124
1125                query.append(_FINDER_COLUMN_P_C_C_CLASSNAMEID_2);
1126
1127                query.append(_FINDER_COLUMN_P_C_C_CLASSPK_2);
1128
1129                String sql = query.toString();
1130
1131                Query q = session.createQuery(sql);
1132
1133                QueryPos qPos = QueryPos.getInstance(q);
1134
1135                qPos.add(passwordPolicyId);
1136
1137                qPos.add(classNameId);
1138
1139                qPos.add(classPK);
1140
1141                count = (Long)q.uniqueResult();
1142            }
1143            catch (Exception e) {
1144                throw processException(e);
1145            }
1146            finally {
1147                if (count == null) {
1148                    count = Long.valueOf(0);
1149                }
1150
1151                FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_P_C_C,
1152                    finderArgs, count);
1153
1154                closeSession(session);
1155            }
1156        }
1157
1158        return count.intValue();
1159    }
1160
1161    public int countAll() throws SystemException {
1162        Object[] finderArgs = new Object[0];
1163
1164        Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_ALL,
1165                finderArgs, this);
1166
1167        if (count == null) {
1168            Session session = null;
1169
1170            try {
1171                session = openSession();
1172
1173                Query q = session.createQuery(_SQL_COUNT_PASSWORDPOLICYREL);
1174
1175                count = (Long)q.uniqueResult();
1176            }
1177            catch (Exception e) {
1178                throw processException(e);
1179            }
1180            finally {
1181                if (count == null) {
1182                    count = Long.valueOf(0);
1183                }
1184
1185                FinderCacheUtil.putResult(FINDER_PATH_COUNT_ALL, finderArgs,
1186                    count);
1187
1188                closeSession(session);
1189            }
1190        }
1191
1192        return count.intValue();
1193    }
1194
1195    public void afterPropertiesSet() {
1196        String[] listenerClassNames = StringUtil.split(GetterUtil.getString(
1197                    com.liferay.portal.util.PropsUtil.get(
1198                        "value.object.listener.com.liferay.portal.model.PasswordPolicyRel")));
1199
1200        if (listenerClassNames.length > 0) {
1201            try {
1202                List<ModelListener<PasswordPolicyRel>> listenersList = new ArrayList<ModelListener<PasswordPolicyRel>>();
1203
1204                for (String listenerClassName : listenerClassNames) {
1205                    listenersList.add((ModelListener<PasswordPolicyRel>)Class.forName(
1206                            listenerClassName).newInstance());
1207                }
1208
1209                listeners = listenersList.toArray(new ModelListener[listenersList.size()]);
1210            }
1211            catch (Exception e) {
1212                _log.error(e);
1213            }
1214        }
1215    }
1216
1217    @BeanReference(type = AccountPersistence.class)
1218    protected AccountPersistence accountPersistence;
1219    @BeanReference(type = AddressPersistence.class)
1220    protected AddressPersistence addressPersistence;
1221    @BeanReference(type = BrowserTrackerPersistence.class)
1222    protected BrowserTrackerPersistence browserTrackerPersistence;
1223    @BeanReference(type = ClassNamePersistence.class)
1224    protected ClassNamePersistence classNamePersistence;
1225    @BeanReference(type = CompanyPersistence.class)
1226    protected CompanyPersistence companyPersistence;
1227    @BeanReference(type = ContactPersistence.class)
1228    protected ContactPersistence contactPersistence;
1229    @BeanReference(type = CountryPersistence.class)
1230    protected CountryPersistence countryPersistence;
1231    @BeanReference(type = EmailAddressPersistence.class)
1232    protected EmailAddressPersistence emailAddressPersistence;
1233    @BeanReference(type = GroupPersistence.class)
1234    protected GroupPersistence groupPersistence;
1235    @BeanReference(type = ImagePersistence.class)
1236    protected ImagePersistence imagePersistence;
1237    @BeanReference(type = LayoutPersistence.class)
1238    protected LayoutPersistence layoutPersistence;
1239    @BeanReference(type = LayoutSetPersistence.class)
1240    protected LayoutSetPersistence layoutSetPersistence;
1241    @BeanReference(type = ListTypePersistence.class)
1242    protected ListTypePersistence listTypePersistence;
1243    @BeanReference(type = LockPersistence.class)
1244    protected LockPersistence lockPersistence;
1245    @BeanReference(type = MembershipRequestPersistence.class)
1246    protected MembershipRequestPersistence membershipRequestPersistence;
1247    @BeanReference(type = OrganizationPersistence.class)
1248    protected OrganizationPersistence organizationPersistence;
1249    @BeanReference(type = OrgGroupPermissionPersistence.class)
1250    protected OrgGroupPermissionPersistence orgGroupPermissionPersistence;
1251    @BeanReference(type = OrgGroupRolePersistence.class)
1252    protected OrgGroupRolePersistence orgGroupRolePersistence;
1253    @BeanReference(type = OrgLaborPersistence.class)
1254    protected OrgLaborPersistence orgLaborPersistence;
1255    @BeanReference(type = PasswordPolicyPersistence.class)
1256    protected PasswordPolicyPersistence passwordPolicyPersistence;
1257    @BeanReference(type = PasswordPolicyRelPersistence.class)
1258    protected PasswordPolicyRelPersistence passwordPolicyRelPersistence;
1259    @BeanReference(type = PasswordTrackerPersistence.class)
1260    protected PasswordTrackerPersistence passwordTrackerPersistence;
1261    @BeanReference(type = PermissionPersistence.class)
1262    protected PermissionPersistence permissionPersistence;
1263    @BeanReference(type = PhonePersistence.class)
1264    protected PhonePersistence phonePersistence;
1265    @BeanReference(type = PluginSettingPersistence.class)
1266    protected PluginSettingPersistence pluginSettingPersistence;
1267    @BeanReference(type = PortletPersistence.class)
1268    protected PortletPersistence portletPersistence;
1269    @BeanReference(type = PortletItemPersistence.class)
1270    protected PortletItemPersistence portletItemPersistence;
1271    @BeanReference(type = PortletPreferencesPersistence.class)
1272    protected PortletPreferencesPersistence portletPreferencesPersistence;
1273    @BeanReference(type = RegionPersistence.class)
1274    protected RegionPersistence regionPersistence;
1275    @BeanReference(type = ReleasePersistence.class)
1276    protected ReleasePersistence releasePersistence;
1277    @BeanReference(type = ResourcePersistence.class)
1278    protected ResourcePersistence resourcePersistence;
1279    @BeanReference(type = ResourceActionPersistence.class)
1280    protected ResourceActionPersistence resourceActionPersistence;
1281    @BeanReference(type = ResourceCodePersistence.class)
1282    protected ResourceCodePersistence resourceCodePersistence;
1283    @BeanReference(type = ResourcePermissionPersistence.class)
1284    protected ResourcePermissionPersistence resourcePermissionPersistence;
1285    @BeanReference(type = RolePersistence.class)
1286    protected RolePersistence rolePersistence;
1287    @BeanReference(type = ServiceComponentPersistence.class)
1288    protected ServiceComponentPersistence serviceComponentPersistence;
1289    @BeanReference(type = ShardPersistence.class)
1290    protected ShardPersistence shardPersistence;
1291    @BeanReference(type = SubscriptionPersistence.class)
1292    protected SubscriptionPersistence subscriptionPersistence;
1293    @BeanReference(type = UserPersistence.class)
1294    protected UserPersistence userPersistence;
1295    @BeanReference(type = UserGroupPersistence.class)
1296    protected UserGroupPersistence userGroupPersistence;
1297    @BeanReference(type = UserGroupGroupRolePersistence.class)
1298    protected UserGroupGroupRolePersistence userGroupGroupRolePersistence;
1299    @BeanReference(type = UserGroupRolePersistence.class)
1300    protected UserGroupRolePersistence userGroupRolePersistence;
1301    @BeanReference(type = UserIdMapperPersistence.class)
1302    protected UserIdMapperPersistence userIdMapperPersistence;
1303    @BeanReference(type = UserTrackerPersistence.class)
1304    protected UserTrackerPersistence userTrackerPersistence;
1305    @BeanReference(type = UserTrackerPathPersistence.class)
1306    protected UserTrackerPathPersistence userTrackerPathPersistence;
1307    @BeanReference(type = WebDAVPropsPersistence.class)
1308    protected WebDAVPropsPersistence webDAVPropsPersistence;
1309    @BeanReference(type = WebsitePersistence.class)
1310    protected WebsitePersistence websitePersistence;
1311    private static final String _SQL_SELECT_PASSWORDPOLICYREL = "SELECT passwordPolicyRel FROM PasswordPolicyRel passwordPolicyRel";
1312    private static final String _SQL_SELECT_PASSWORDPOLICYREL_WHERE = "SELECT passwordPolicyRel FROM PasswordPolicyRel passwordPolicyRel WHERE ";
1313    private static final String _SQL_COUNT_PASSWORDPOLICYREL = "SELECT COUNT(passwordPolicyRel) FROM PasswordPolicyRel passwordPolicyRel";
1314    private static final String _SQL_COUNT_PASSWORDPOLICYREL_WHERE = "SELECT COUNT(passwordPolicyRel) FROM PasswordPolicyRel passwordPolicyRel WHERE ";
1315    private static final String _FINDER_COLUMN_PASSWORDPOLICYID_PASSWORDPOLICYID_2 =
1316        "passwordPolicyRel.passwordPolicyId = ?";
1317    private static final String _FINDER_COLUMN_C_C_CLASSNAMEID_2 = "passwordPolicyRel.classNameId = ? AND ";
1318    private static final String _FINDER_COLUMN_C_C_CLASSPK_2 = "passwordPolicyRel.classPK = ?";
1319    private static final String _FINDER_COLUMN_P_C_C_PASSWORDPOLICYID_2 = "passwordPolicyRel.passwordPolicyId = ? AND ";
1320    private static final String _FINDER_COLUMN_P_C_C_CLASSNAMEID_2 = "passwordPolicyRel.classNameId = ? AND ";
1321    private static final String _FINDER_COLUMN_P_C_C_CLASSPK_2 = "passwordPolicyRel.classPK = ?";
1322    private static final String _ORDER_BY_ENTITY_ALIAS = "passwordPolicyRel.";
1323    private static final String _NO_SUCH_ENTITY_WITH_PRIMARY_KEY = "No PasswordPolicyRel exists with the primary key ";
1324    private static final String _NO_SUCH_ENTITY_WITH_KEY = "No PasswordPolicyRel exists with the key {";
1325    private static Log _log = LogFactoryUtil.getLog(PasswordPolicyRelPersistenceImpl.class);
1326}