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