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