001
014
015 package com.liferay.portal.service.persistence;
016
017 import com.liferay.portal.NoSuchModelException;
018 import com.liferay.portal.NoSuchPasswordPolicyRelException;
019 import com.liferay.portal.kernel.bean.BeanReference;
020 import com.liferay.portal.kernel.cache.CacheRegistryUtil;
021 import com.liferay.portal.kernel.dao.orm.EntityCacheUtil;
022 import com.liferay.portal.kernel.dao.orm.FinderCacheUtil;
023 import com.liferay.portal.kernel.dao.orm.FinderPath;
024 import com.liferay.portal.kernel.dao.orm.Query;
025 import com.liferay.portal.kernel.dao.orm.QueryPos;
026 import com.liferay.portal.kernel.dao.orm.QueryUtil;
027 import com.liferay.portal.kernel.dao.orm.Session;
028 import com.liferay.portal.kernel.exception.SystemException;
029 import com.liferay.portal.kernel.log.Log;
030 import com.liferay.portal.kernel.log.LogFactoryUtil;
031 import com.liferay.portal.kernel.util.GetterUtil;
032 import com.liferay.portal.kernel.util.InstanceFactory;
033 import com.liferay.portal.kernel.util.OrderByComparator;
034 import com.liferay.portal.kernel.util.StringBundler;
035 import com.liferay.portal.kernel.util.StringPool;
036 import com.liferay.portal.kernel.util.StringUtil;
037 import com.liferay.portal.model.CacheModel;
038 import com.liferay.portal.model.ModelListener;
039 import com.liferay.portal.model.PasswordPolicyRel;
040 import com.liferay.portal.model.impl.PasswordPolicyRelImpl;
041 import com.liferay.portal.model.impl.PasswordPolicyRelModelImpl;
042 import com.liferay.portal.service.persistence.impl.BasePersistenceImpl;
043
044 import java.io.Serializable;
045
046 import java.util.ArrayList;
047 import java.util.Collections;
048 import java.util.List;
049
050
062 public class PasswordPolicyRelPersistenceImpl extends BasePersistenceImpl<PasswordPolicyRel>
063 implements PasswordPolicyRelPersistence {
064
069 public static final String FINDER_CLASS_NAME_ENTITY = PasswordPolicyRelImpl.class.getName();
070 public static final String FINDER_CLASS_NAME_LIST_WITH_PAGINATION = FINDER_CLASS_NAME_ENTITY +
071 ".List1";
072 public static final String FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION = FINDER_CLASS_NAME_ENTITY +
073 ".List2";
074 public static final FinderPath FINDER_PATH_WITH_PAGINATION_FIND_BY_PASSWORDPOLICYID =
075 new FinderPath(PasswordPolicyRelModelImpl.ENTITY_CACHE_ENABLED,
076 PasswordPolicyRelModelImpl.FINDER_CACHE_ENABLED,
077 PasswordPolicyRelImpl.class,
078 FINDER_CLASS_NAME_LIST_WITH_PAGINATION, "findByPasswordPolicyId",
079 new String[] {
080 Long.class.getName(),
081
082 "java.lang.Integer", "java.lang.Integer",
083 "com.liferay.portal.kernel.util.OrderByComparator"
084 });
085 public static final FinderPath FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_PASSWORDPOLICYID =
086 new FinderPath(PasswordPolicyRelModelImpl.ENTITY_CACHE_ENABLED,
087 PasswordPolicyRelModelImpl.FINDER_CACHE_ENABLED,
088 PasswordPolicyRelImpl.class,
089 FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION,
090 "findByPasswordPolicyId", new String[] { Long.class.getName() },
091 PasswordPolicyRelModelImpl.PASSWORDPOLICYID_COLUMN_BITMASK);
092 public static final FinderPath FINDER_PATH_COUNT_BY_PASSWORDPOLICYID = new FinderPath(PasswordPolicyRelModelImpl.ENTITY_CACHE_ENABLED,
093 PasswordPolicyRelModelImpl.FINDER_CACHE_ENABLED, Long.class,
094 FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION,
095 "countByPasswordPolicyId", new String[] { Long.class.getName() });
096 public static final FinderPath FINDER_PATH_FETCH_BY_C_C = new FinderPath(PasswordPolicyRelModelImpl.ENTITY_CACHE_ENABLED,
097 PasswordPolicyRelModelImpl.FINDER_CACHE_ENABLED,
098 PasswordPolicyRelImpl.class, FINDER_CLASS_NAME_ENTITY,
099 "fetchByC_C",
100 new String[] { Long.class.getName(), Long.class.getName() },
101 PasswordPolicyRelModelImpl.CLASSNAMEID_COLUMN_BITMASK |
102 PasswordPolicyRelModelImpl.CLASSPK_COLUMN_BITMASK);
103 public static final FinderPath FINDER_PATH_COUNT_BY_C_C = new FinderPath(PasswordPolicyRelModelImpl.ENTITY_CACHE_ENABLED,
104 PasswordPolicyRelModelImpl.FINDER_CACHE_ENABLED, Long.class,
105 FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "countByC_C",
106 new String[] { Long.class.getName(), Long.class.getName() });
107 public static final FinderPath FINDER_PATH_FETCH_BY_P_C_C = new FinderPath(PasswordPolicyRelModelImpl.ENTITY_CACHE_ENABLED,
108 PasswordPolicyRelModelImpl.FINDER_CACHE_ENABLED,
109 PasswordPolicyRelImpl.class, FINDER_CLASS_NAME_ENTITY,
110 "fetchByP_C_C",
111 new String[] {
112 Long.class.getName(), Long.class.getName(), Long.class.getName()
113 },
114 PasswordPolicyRelModelImpl.PASSWORDPOLICYID_COLUMN_BITMASK |
115 PasswordPolicyRelModelImpl.CLASSNAMEID_COLUMN_BITMASK |
116 PasswordPolicyRelModelImpl.CLASSPK_COLUMN_BITMASK);
117 public static final FinderPath FINDER_PATH_COUNT_BY_P_C_C = new FinderPath(PasswordPolicyRelModelImpl.ENTITY_CACHE_ENABLED,
118 PasswordPolicyRelModelImpl.FINDER_CACHE_ENABLED, Long.class,
119 FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "countByP_C_C",
120 new String[] {
121 Long.class.getName(), Long.class.getName(), Long.class.getName()
122 });
123 public static final FinderPath FINDER_PATH_WITH_PAGINATION_FIND_ALL = new FinderPath(PasswordPolicyRelModelImpl.ENTITY_CACHE_ENABLED,
124 PasswordPolicyRelModelImpl.FINDER_CACHE_ENABLED,
125 PasswordPolicyRelImpl.class,
126 FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "findAll", new String[0]);
127 public static final FinderPath FINDER_PATH_WITHOUT_PAGINATION_FIND_ALL = new FinderPath(PasswordPolicyRelModelImpl.ENTITY_CACHE_ENABLED,
128 PasswordPolicyRelModelImpl.FINDER_CACHE_ENABLED,
129 PasswordPolicyRelImpl.class,
130 FINDER_CLASS_NAME_LIST_WITH_PAGINATION, "findAll", new String[0]);
131 public static final FinderPath FINDER_PATH_COUNT_ALL = new FinderPath(PasswordPolicyRelModelImpl.ENTITY_CACHE_ENABLED,
132 PasswordPolicyRelModelImpl.FINDER_CACHE_ENABLED, Long.class,
133 FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "countAll", new String[0]);
134
135
140 public void cacheResult(PasswordPolicyRel passwordPolicyRel) {
141 EntityCacheUtil.putResult(PasswordPolicyRelModelImpl.ENTITY_CACHE_ENABLED,
142 PasswordPolicyRelImpl.class, passwordPolicyRel.getPrimaryKey(),
143 passwordPolicyRel);
144
145 FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_C_C,
146 new Object[] {
147 Long.valueOf(passwordPolicyRel.getClassNameId()),
148 Long.valueOf(passwordPolicyRel.getClassPK())
149 }, passwordPolicyRel);
150
151 FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_P_C_C,
152 new Object[] {
153 Long.valueOf(passwordPolicyRel.getPasswordPolicyId()),
154 Long.valueOf(passwordPolicyRel.getClassNameId()),
155 Long.valueOf(passwordPolicyRel.getClassPK())
156 }, passwordPolicyRel);
157
158 passwordPolicyRel.resetOriginalValues();
159 }
160
161
166 public void cacheResult(List<PasswordPolicyRel> passwordPolicyRels) {
167 for (PasswordPolicyRel passwordPolicyRel : passwordPolicyRels) {
168 if (EntityCacheUtil.getResult(
169 PasswordPolicyRelModelImpl.ENTITY_CACHE_ENABLED,
170 PasswordPolicyRelImpl.class,
171 passwordPolicyRel.getPrimaryKey()) == null) {
172 cacheResult(passwordPolicyRel);
173 }
174 else {
175 passwordPolicyRel.resetOriginalValues();
176 }
177 }
178 }
179
180
187 @Override
188 public void clearCache() {
189 if (_HIBERNATE_CACHE_USE_SECOND_LEVEL_CACHE) {
190 CacheRegistryUtil.clear(PasswordPolicyRelImpl.class.getName());
191 }
192
193 EntityCacheUtil.clearCache(PasswordPolicyRelImpl.class.getName());
194
195 FinderCacheUtil.clearCache(FINDER_CLASS_NAME_ENTITY);
196 FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
197 FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
198 }
199
200
207 @Override
208 public void clearCache(PasswordPolicyRel passwordPolicyRel) {
209 EntityCacheUtil.removeResult(PasswordPolicyRelModelImpl.ENTITY_CACHE_ENABLED,
210 PasswordPolicyRelImpl.class, passwordPolicyRel.getPrimaryKey());
211
212 FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
213 FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
214
215 clearUniqueFindersCache(passwordPolicyRel);
216 }
217
218 @Override
219 public void clearCache(List<PasswordPolicyRel> passwordPolicyRels) {
220 FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
221 FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
222
223 for (PasswordPolicyRel passwordPolicyRel : passwordPolicyRels) {
224 EntityCacheUtil.removeResult(PasswordPolicyRelModelImpl.ENTITY_CACHE_ENABLED,
225 PasswordPolicyRelImpl.class, passwordPolicyRel.getPrimaryKey());
226
227 clearUniqueFindersCache(passwordPolicyRel);
228 }
229 }
230
231 protected void clearUniqueFindersCache(PasswordPolicyRel passwordPolicyRel) {
232 FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_C_C,
233 new Object[] {
234 Long.valueOf(passwordPolicyRel.getClassNameId()),
235 Long.valueOf(passwordPolicyRel.getClassPK())
236 });
237
238 FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_P_C_C,
239 new Object[] {
240 Long.valueOf(passwordPolicyRel.getPasswordPolicyId()),
241 Long.valueOf(passwordPolicyRel.getClassNameId()),
242 Long.valueOf(passwordPolicyRel.getClassPK())
243 });
244 }
245
246
252 public PasswordPolicyRel create(long passwordPolicyRelId) {
253 PasswordPolicyRel passwordPolicyRel = new PasswordPolicyRelImpl();
254
255 passwordPolicyRel.setNew(true);
256 passwordPolicyRel.setPrimaryKey(passwordPolicyRelId);
257
258 return passwordPolicyRel;
259 }
260
261
269 public PasswordPolicyRel remove(long passwordPolicyRelId)
270 throws NoSuchPasswordPolicyRelException, SystemException {
271 return remove(Long.valueOf(passwordPolicyRelId));
272 }
273
274
282 @Override
283 public PasswordPolicyRel remove(Serializable primaryKey)
284 throws NoSuchPasswordPolicyRelException, SystemException {
285 Session session = null;
286
287 try {
288 session = openSession();
289
290 PasswordPolicyRel passwordPolicyRel = (PasswordPolicyRel)session.get(PasswordPolicyRelImpl.class,
291 primaryKey);
292
293 if (passwordPolicyRel == null) {
294 if (_log.isWarnEnabled()) {
295 _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey);
296 }
297
298 throw new NoSuchPasswordPolicyRelException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
299 primaryKey);
300 }
301
302 return remove(passwordPolicyRel);
303 }
304 catch (NoSuchPasswordPolicyRelException nsee) {
305 throw nsee;
306 }
307 catch (Exception e) {
308 throw processException(e);
309 }
310 finally {
311 closeSession(session);
312 }
313 }
314
315 @Override
316 protected PasswordPolicyRel removeImpl(PasswordPolicyRel passwordPolicyRel)
317 throws SystemException {
318 passwordPolicyRel = toUnwrappedModel(passwordPolicyRel);
319
320 Session session = null;
321
322 try {
323 session = openSession();
324
325 BatchSessionUtil.delete(session, passwordPolicyRel);
326 }
327 catch (Exception e) {
328 throw processException(e);
329 }
330 finally {
331 closeSession(session);
332 }
333
334 clearCache(passwordPolicyRel);
335
336 return passwordPolicyRel;
337 }
338
339 @Override
340 public PasswordPolicyRel updateImpl(
341 com.liferay.portal.model.PasswordPolicyRel passwordPolicyRel,
342 boolean merge) throws SystemException {
343 passwordPolicyRel = toUnwrappedModel(passwordPolicyRel);
344
345 boolean isNew = passwordPolicyRel.isNew();
346
347 PasswordPolicyRelModelImpl passwordPolicyRelModelImpl = (PasswordPolicyRelModelImpl)passwordPolicyRel;
348
349 Session session = null;
350
351 try {
352 session = openSession();
353
354 BatchSessionUtil.update(session, passwordPolicyRel, merge);
355
356 passwordPolicyRel.setNew(false);
357 }
358 catch (Exception e) {
359 throw processException(e);
360 }
361 finally {
362 closeSession(session);
363 }
364
365 FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
366
367 if (isNew || !PasswordPolicyRelModelImpl.COLUMN_BITMASK_ENABLED) {
368 FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
369 }
370
371 else {
372 if ((passwordPolicyRelModelImpl.getColumnBitmask() &
373 FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_PASSWORDPOLICYID.getColumnBitmask()) != 0) {
374 Object[] args = new Object[] {
375 Long.valueOf(passwordPolicyRelModelImpl.getOriginalPasswordPolicyId())
376 };
377
378 FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_PASSWORDPOLICYID,
379 args);
380 FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_PASSWORDPOLICYID,
381 args);
382
383 args = new Object[] {
384 Long.valueOf(passwordPolicyRelModelImpl.getPasswordPolicyId())
385 };
386
387 FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_PASSWORDPOLICYID,
388 args);
389 FinderCacheUtil.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_PASSWORDPOLICYID,
390 args);
391 }
392 }
393
394 EntityCacheUtil.putResult(PasswordPolicyRelModelImpl.ENTITY_CACHE_ENABLED,
395 PasswordPolicyRelImpl.class, passwordPolicyRel.getPrimaryKey(),
396 passwordPolicyRel);
397
398 if (isNew) {
399 FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_C_C,
400 new Object[] {
401 Long.valueOf(passwordPolicyRel.getClassNameId()),
402 Long.valueOf(passwordPolicyRel.getClassPK())
403 }, passwordPolicyRel);
404
405 FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_P_C_C,
406 new Object[] {
407 Long.valueOf(passwordPolicyRel.getPasswordPolicyId()),
408 Long.valueOf(passwordPolicyRel.getClassNameId()),
409 Long.valueOf(passwordPolicyRel.getClassPK())
410 }, passwordPolicyRel);
411 }
412 else {
413 if ((passwordPolicyRelModelImpl.getColumnBitmask() &
414 FINDER_PATH_FETCH_BY_C_C.getColumnBitmask()) != 0) {
415 Object[] args = new Object[] {
416 Long.valueOf(passwordPolicyRelModelImpl.getOriginalClassNameId()),
417 Long.valueOf(passwordPolicyRelModelImpl.getOriginalClassPK())
418 };
419
420 FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_C_C, args);
421 FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_C_C, args);
422
423 FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_C_C,
424 new Object[] {
425 Long.valueOf(passwordPolicyRel.getClassNameId()),
426 Long.valueOf(passwordPolicyRel.getClassPK())
427 }, passwordPolicyRel);
428 }
429
430 if ((passwordPolicyRelModelImpl.getColumnBitmask() &
431 FINDER_PATH_FETCH_BY_P_C_C.getColumnBitmask()) != 0) {
432 Object[] args = new Object[] {
433 Long.valueOf(passwordPolicyRelModelImpl.getOriginalPasswordPolicyId()),
434 Long.valueOf(passwordPolicyRelModelImpl.getOriginalClassNameId()),
435 Long.valueOf(passwordPolicyRelModelImpl.getOriginalClassPK())
436 };
437
438 FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_P_C_C, args);
439 FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_P_C_C, args);
440
441 FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_P_C_C,
442 new Object[] {
443 Long.valueOf(passwordPolicyRel.getPasswordPolicyId()),
444 Long.valueOf(passwordPolicyRel.getClassNameId()),
445 Long.valueOf(passwordPolicyRel.getClassPK())
446 }, passwordPolicyRel);
447 }
448 }
449
450 return passwordPolicyRel;
451 }
452
453 protected PasswordPolicyRel toUnwrappedModel(
454 PasswordPolicyRel passwordPolicyRel) {
455 if (passwordPolicyRel instanceof PasswordPolicyRelImpl) {
456 return passwordPolicyRel;
457 }
458
459 PasswordPolicyRelImpl passwordPolicyRelImpl = new PasswordPolicyRelImpl();
460
461 passwordPolicyRelImpl.setNew(passwordPolicyRel.isNew());
462 passwordPolicyRelImpl.setPrimaryKey(passwordPolicyRel.getPrimaryKey());
463
464 passwordPolicyRelImpl.setPasswordPolicyRelId(passwordPolicyRel.getPasswordPolicyRelId());
465 passwordPolicyRelImpl.setPasswordPolicyId(passwordPolicyRel.getPasswordPolicyId());
466 passwordPolicyRelImpl.setClassNameId(passwordPolicyRel.getClassNameId());
467 passwordPolicyRelImpl.setClassPK(passwordPolicyRel.getClassPK());
468
469 return passwordPolicyRelImpl;
470 }
471
472
480 @Override
481 public PasswordPolicyRel findByPrimaryKey(Serializable primaryKey)
482 throws NoSuchModelException, SystemException {
483 return findByPrimaryKey(((Long)primaryKey).longValue());
484 }
485
486
494 public PasswordPolicyRel findByPrimaryKey(long passwordPolicyRelId)
495 throws NoSuchPasswordPolicyRelException, SystemException {
496 PasswordPolicyRel passwordPolicyRel = fetchByPrimaryKey(passwordPolicyRelId);
497
498 if (passwordPolicyRel == null) {
499 if (_log.isWarnEnabled()) {
500 _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
501 passwordPolicyRelId);
502 }
503
504 throw new NoSuchPasswordPolicyRelException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
505 passwordPolicyRelId);
506 }
507
508 return passwordPolicyRel;
509 }
510
511
518 @Override
519 public PasswordPolicyRel fetchByPrimaryKey(Serializable primaryKey)
520 throws SystemException {
521 return fetchByPrimaryKey(((Long)primaryKey).longValue());
522 }
523
524
531 public PasswordPolicyRel fetchByPrimaryKey(long passwordPolicyRelId)
532 throws SystemException {
533 PasswordPolicyRel passwordPolicyRel = (PasswordPolicyRel)EntityCacheUtil.getResult(PasswordPolicyRelModelImpl.ENTITY_CACHE_ENABLED,
534 PasswordPolicyRelImpl.class, passwordPolicyRelId);
535
536 if (passwordPolicyRel == _nullPasswordPolicyRel) {
537 return null;
538 }
539
540 if (passwordPolicyRel == null) {
541 Session session = null;
542
543 boolean hasException = false;
544
545 try {
546 session = openSession();
547
548 passwordPolicyRel = (PasswordPolicyRel)session.get(PasswordPolicyRelImpl.class,
549 Long.valueOf(passwordPolicyRelId));
550 }
551 catch (Exception e) {
552 hasException = true;
553
554 throw processException(e);
555 }
556 finally {
557 if (passwordPolicyRel != null) {
558 cacheResult(passwordPolicyRel);
559 }
560 else if (!hasException) {
561 EntityCacheUtil.putResult(PasswordPolicyRelModelImpl.ENTITY_CACHE_ENABLED,
562 PasswordPolicyRelImpl.class, passwordPolicyRelId,
563 _nullPasswordPolicyRel);
564 }
565
566 closeSession(session);
567 }
568 }
569
570 return passwordPolicyRel;
571 }
572
573
580 public List<PasswordPolicyRel> findByPasswordPolicyId(long passwordPolicyId)
581 throws SystemException {
582 return findByPasswordPolicyId(passwordPolicyId, QueryUtil.ALL_POS,
583 QueryUtil.ALL_POS, null);
584 }
585
586
599 public List<PasswordPolicyRel> findByPasswordPolicyId(
600 long passwordPolicyId, int start, int end) throws SystemException {
601 return findByPasswordPolicyId(passwordPolicyId, start, end, null);
602 }
603
604
618 public List<PasswordPolicyRel> findByPasswordPolicyId(
619 long passwordPolicyId, int start, int end,
620 OrderByComparator orderByComparator) throws SystemException {
621 FinderPath finderPath = null;
622 Object[] finderArgs = null;
623
624 if ((start == QueryUtil.ALL_POS) && (end == QueryUtil.ALL_POS) &&
625 (orderByComparator == null)) {
626 finderPath = FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_PASSWORDPOLICYID;
627 finderArgs = new Object[] { passwordPolicyId };
628 }
629 else {
630 finderPath = FINDER_PATH_WITH_PAGINATION_FIND_BY_PASSWORDPOLICYID;
631 finderArgs = new Object[] {
632 passwordPolicyId,
633
634 start, end, orderByComparator
635 };
636 }
637
638 List<PasswordPolicyRel> list = (List<PasswordPolicyRel>)FinderCacheUtil.getResult(finderPath,
639 finderArgs, this);
640
641 if (list == null) {
642 StringBundler query = null;
643
644 if (orderByComparator != null) {
645 query = new StringBundler(3 +
646 (orderByComparator.getOrderByFields().length * 3));
647 }
648 else {
649 query = new StringBundler(2);
650 }
651
652 query.append(_SQL_SELECT_PASSWORDPOLICYREL_WHERE);
653
654 query.append(_FINDER_COLUMN_PASSWORDPOLICYID_PASSWORDPOLICYID_2);
655
656 if (orderByComparator != null) {
657 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
658 orderByComparator);
659 }
660
661 String sql = query.toString();
662
663 Session session = null;
664
665 try {
666 session = openSession();
667
668 Query q = session.createQuery(sql);
669
670 QueryPos qPos = QueryPos.getInstance(q);
671
672 qPos.add(passwordPolicyId);
673
674 list = (List<PasswordPolicyRel>)QueryUtil.list(q, getDialect(),
675 start, end);
676 }
677 catch (Exception e) {
678 throw processException(e);
679 }
680 finally {
681 if (list == null) {
682 FinderCacheUtil.removeResult(finderPath, finderArgs);
683 }
684 else {
685 cacheResult(list);
686
687 FinderCacheUtil.putResult(finderPath, finderArgs, list);
688 }
689
690 closeSession(session);
691 }
692 }
693
694 return list;
695 }
696
697
710 public PasswordPolicyRel findByPasswordPolicyId_First(
711 long passwordPolicyId, OrderByComparator orderByComparator)
712 throws NoSuchPasswordPolicyRelException, SystemException {
713 List<PasswordPolicyRel> list = findByPasswordPolicyId(passwordPolicyId,
714 0, 1, orderByComparator);
715
716 if (list.isEmpty()) {
717 StringBundler msg = new StringBundler(4);
718
719 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
720
721 msg.append("passwordPolicyId=");
722 msg.append(passwordPolicyId);
723
724 msg.append(StringPool.CLOSE_CURLY_BRACE);
725
726 throw new NoSuchPasswordPolicyRelException(msg.toString());
727 }
728 else {
729 return list.get(0);
730 }
731 }
732
733
746 public PasswordPolicyRel findByPasswordPolicyId_Last(
747 long passwordPolicyId, OrderByComparator orderByComparator)
748 throws NoSuchPasswordPolicyRelException, SystemException {
749 int count = countByPasswordPolicyId(passwordPolicyId);
750
751 List<PasswordPolicyRel> list = findByPasswordPolicyId(passwordPolicyId,
752 count - 1, count, orderByComparator);
753
754 if (list.isEmpty()) {
755 StringBundler msg = new StringBundler(4);
756
757 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
758
759 msg.append("passwordPolicyId=");
760 msg.append(passwordPolicyId);
761
762 msg.append(StringPool.CLOSE_CURLY_BRACE);
763
764 throw new NoSuchPasswordPolicyRelException(msg.toString());
765 }
766 else {
767 return list.get(0);
768 }
769 }
770
771
785 public PasswordPolicyRel[] findByPasswordPolicyId_PrevAndNext(
786 long passwordPolicyRelId, long passwordPolicyId,
787 OrderByComparator orderByComparator)
788 throws NoSuchPasswordPolicyRelException, SystemException {
789 PasswordPolicyRel passwordPolicyRel = findByPrimaryKey(passwordPolicyRelId);
790
791 Session session = null;
792
793 try {
794 session = openSession();
795
796 PasswordPolicyRel[] array = new PasswordPolicyRelImpl[3];
797
798 array[0] = getByPasswordPolicyId_PrevAndNext(session,
799 passwordPolicyRel, passwordPolicyId, orderByComparator, true);
800
801 array[1] = passwordPolicyRel;
802
803 array[2] = getByPasswordPolicyId_PrevAndNext(session,
804 passwordPolicyRel, passwordPolicyId, orderByComparator,
805 false);
806
807 return array;
808 }
809 catch (Exception e) {
810 throw processException(e);
811 }
812 finally {
813 closeSession(session);
814 }
815 }
816
817 protected PasswordPolicyRel getByPasswordPolicyId_PrevAndNext(
818 Session session, PasswordPolicyRel passwordPolicyRel,
819 long passwordPolicyId, OrderByComparator orderByComparator,
820 boolean previous) {
821 StringBundler query = null;
822
823 if (orderByComparator != null) {
824 query = new StringBundler(6 +
825 (orderByComparator.getOrderByFields().length * 6));
826 }
827 else {
828 query = new StringBundler(3);
829 }
830
831 query.append(_SQL_SELECT_PASSWORDPOLICYREL_WHERE);
832
833 query.append(_FINDER_COLUMN_PASSWORDPOLICYID_PASSWORDPOLICYID_2);
834
835 if (orderByComparator != null) {
836 String[] orderByConditionFields = orderByComparator.getOrderByConditionFields();
837
838 if (orderByConditionFields.length > 0) {
839 query.append(WHERE_AND);
840 }
841
842 for (int i = 0; i < orderByConditionFields.length; i++) {
843 query.append(_ORDER_BY_ENTITY_ALIAS);
844 query.append(orderByConditionFields[i]);
845
846 if ((i + 1) < orderByConditionFields.length) {
847 if (orderByComparator.isAscending() ^ previous) {
848 query.append(WHERE_GREATER_THAN_HAS_NEXT);
849 }
850 else {
851 query.append(WHERE_LESSER_THAN_HAS_NEXT);
852 }
853 }
854 else {
855 if (orderByComparator.isAscending() ^ previous) {
856 query.append(WHERE_GREATER_THAN);
857 }
858 else {
859 query.append(WHERE_LESSER_THAN);
860 }
861 }
862 }
863
864 query.append(ORDER_BY_CLAUSE);
865
866 String[] orderByFields = orderByComparator.getOrderByFields();
867
868 for (int i = 0; i < orderByFields.length; i++) {
869 query.append(_ORDER_BY_ENTITY_ALIAS);
870 query.append(orderByFields[i]);
871
872 if ((i + 1) < orderByFields.length) {
873 if (orderByComparator.isAscending() ^ previous) {
874 query.append(ORDER_BY_ASC_HAS_NEXT);
875 }
876 else {
877 query.append(ORDER_BY_DESC_HAS_NEXT);
878 }
879 }
880 else {
881 if (orderByComparator.isAscending() ^ previous) {
882 query.append(ORDER_BY_ASC);
883 }
884 else {
885 query.append(ORDER_BY_DESC);
886 }
887 }
888 }
889 }
890
891 String sql = query.toString();
892
893 Query q = session.createQuery(sql);
894
895 q.setFirstResult(0);
896 q.setMaxResults(2);
897
898 QueryPos qPos = QueryPos.getInstance(q);
899
900 qPos.add(passwordPolicyId);
901
902 if (orderByComparator != null) {
903 Object[] values = orderByComparator.getOrderByConditionValues(passwordPolicyRel);
904
905 for (Object value : values) {
906 qPos.add(value);
907 }
908 }
909
910 List<PasswordPolicyRel> list = q.list();
911
912 if (list.size() == 2) {
913 return list.get(1);
914 }
915 else {
916 return null;
917 }
918 }
919
920
929 public PasswordPolicyRel findByC_C(long classNameId, long classPK)
930 throws NoSuchPasswordPolicyRelException, SystemException {
931 PasswordPolicyRel passwordPolicyRel = fetchByC_C(classNameId, classPK);
932
933 if (passwordPolicyRel == null) {
934 StringBundler msg = new StringBundler(6);
935
936 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
937
938 msg.append("classNameId=");
939 msg.append(classNameId);
940
941 msg.append(", classPK=");
942 msg.append(classPK);
943
944 msg.append(StringPool.CLOSE_CURLY_BRACE);
945
946 if (_log.isWarnEnabled()) {
947 _log.warn(msg.toString());
948 }
949
950 throw new NoSuchPasswordPolicyRelException(msg.toString());
951 }
952
953 return passwordPolicyRel;
954 }
955
956
964 public PasswordPolicyRel fetchByC_C(long classNameId, long classPK)
965 throws SystemException {
966 return fetchByC_C(classNameId, classPK, true);
967 }
968
969
978 public PasswordPolicyRel fetchByC_C(long classNameId, long classPK,
979 boolean retrieveFromCache) throws SystemException {
980 Object[] finderArgs = new Object[] { classNameId, classPK };
981
982 Object result = null;
983
984 if (retrieveFromCache) {
985 result = FinderCacheUtil.getResult(FINDER_PATH_FETCH_BY_C_C,
986 finderArgs, this);
987 }
988
989 if (result == null) {
990 StringBundler query = new StringBundler(3);
991
992 query.append(_SQL_SELECT_PASSWORDPOLICYREL_WHERE);
993
994 query.append(_FINDER_COLUMN_C_C_CLASSNAMEID_2);
995
996 query.append(_FINDER_COLUMN_C_C_CLASSPK_2);
997
998 String sql = query.toString();
999
1000 Session session = null;
1001
1002 try {
1003 session = openSession();
1004
1005 Query q = session.createQuery(sql);
1006
1007 QueryPos qPos = QueryPos.getInstance(q);
1008
1009 qPos.add(classNameId);
1010
1011 qPos.add(classPK);
1012
1013 List<PasswordPolicyRel> list = q.list();
1014
1015 result = list;
1016
1017 PasswordPolicyRel passwordPolicyRel = null;
1018
1019 if (list.isEmpty()) {
1020 FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_C_C,
1021 finderArgs, list);
1022 }
1023 else {
1024 passwordPolicyRel = list.get(0);
1025
1026 cacheResult(passwordPolicyRel);
1027
1028 if ((passwordPolicyRel.getClassNameId() != classNameId) ||
1029 (passwordPolicyRel.getClassPK() != classPK)) {
1030 FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_C_C,
1031 finderArgs, passwordPolicyRel);
1032 }
1033 }
1034
1035 return passwordPolicyRel;
1036 }
1037 catch (Exception e) {
1038 throw processException(e);
1039 }
1040 finally {
1041 if (result == null) {
1042 FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_C_C,
1043 finderArgs);
1044 }
1045
1046 closeSession(session);
1047 }
1048 }
1049 else {
1050 if (result instanceof List<?>) {
1051 return null;
1052 }
1053 else {
1054 return (PasswordPolicyRel)result;
1055 }
1056 }
1057 }
1058
1059
1069 public PasswordPolicyRel findByP_C_C(long passwordPolicyId,
1070 long classNameId, long classPK)
1071 throws NoSuchPasswordPolicyRelException, SystemException {
1072 PasswordPolicyRel passwordPolicyRel = fetchByP_C_C(passwordPolicyId,
1073 classNameId, classPK);
1074
1075 if (passwordPolicyRel == null) {
1076 StringBundler msg = new StringBundler(8);
1077
1078 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
1079
1080 msg.append("passwordPolicyId=");
1081 msg.append(passwordPolicyId);
1082
1083 msg.append(", classNameId=");
1084 msg.append(classNameId);
1085
1086 msg.append(", classPK=");
1087 msg.append(classPK);
1088
1089 msg.append(StringPool.CLOSE_CURLY_BRACE);
1090
1091 if (_log.isWarnEnabled()) {
1092 _log.warn(msg.toString());
1093 }
1094
1095 throw new NoSuchPasswordPolicyRelException(msg.toString());
1096 }
1097
1098 return passwordPolicyRel;
1099 }
1100
1101
1110 public PasswordPolicyRel fetchByP_C_C(long passwordPolicyId,
1111 long classNameId, long classPK) throws SystemException {
1112 return fetchByP_C_C(passwordPolicyId, classNameId, classPK, true);
1113 }
1114
1115
1125 public PasswordPolicyRel fetchByP_C_C(long passwordPolicyId,
1126 long classNameId, long classPK, boolean retrieveFromCache)
1127 throws SystemException {
1128 Object[] finderArgs = new Object[] {
1129 passwordPolicyId, classNameId, classPK
1130 };
1131
1132 Object result = null;
1133
1134 if (retrieveFromCache) {
1135 result = FinderCacheUtil.getResult(FINDER_PATH_FETCH_BY_P_C_C,
1136 finderArgs, this);
1137 }
1138
1139 if (result == null) {
1140 StringBundler query = new StringBundler(4);
1141
1142 query.append(_SQL_SELECT_PASSWORDPOLICYREL_WHERE);
1143
1144 query.append(_FINDER_COLUMN_P_C_C_PASSWORDPOLICYID_2);
1145
1146 query.append(_FINDER_COLUMN_P_C_C_CLASSNAMEID_2);
1147
1148 query.append(_FINDER_COLUMN_P_C_C_CLASSPK_2);
1149
1150 String sql = query.toString();
1151
1152 Session session = null;
1153
1154 try {
1155 session = openSession();
1156
1157 Query q = session.createQuery(sql);
1158
1159 QueryPos qPos = QueryPos.getInstance(q);
1160
1161 qPos.add(passwordPolicyId);
1162
1163 qPos.add(classNameId);
1164
1165 qPos.add(classPK);
1166
1167 List<PasswordPolicyRel> list = q.list();
1168
1169 result = list;
1170
1171 PasswordPolicyRel passwordPolicyRel = null;
1172
1173 if (list.isEmpty()) {
1174 FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_P_C_C,
1175 finderArgs, list);
1176 }
1177 else {
1178 passwordPolicyRel = list.get(0);
1179
1180 cacheResult(passwordPolicyRel);
1181
1182 if ((passwordPolicyRel.getPasswordPolicyId() != passwordPolicyId) ||
1183 (passwordPolicyRel.getClassNameId() != classNameId) ||
1184 (passwordPolicyRel.getClassPK() != classPK)) {
1185 FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_P_C_C,
1186 finderArgs, passwordPolicyRel);
1187 }
1188 }
1189
1190 return passwordPolicyRel;
1191 }
1192 catch (Exception e) {
1193 throw processException(e);
1194 }
1195 finally {
1196 if (result == null) {
1197 FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_P_C_C,
1198 finderArgs);
1199 }
1200
1201 closeSession(session);
1202 }
1203 }
1204 else {
1205 if (result instanceof List<?>) {
1206 return null;
1207 }
1208 else {
1209 return (PasswordPolicyRel)result;
1210 }
1211 }
1212 }
1213
1214
1220 public List<PasswordPolicyRel> findAll() throws SystemException {
1221 return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
1222 }
1223
1224
1236 public List<PasswordPolicyRel> findAll(int start, int end)
1237 throws SystemException {
1238 return findAll(start, end, null);
1239 }
1240
1241
1254 public List<PasswordPolicyRel> findAll(int start, int end,
1255 OrderByComparator orderByComparator) throws SystemException {
1256 FinderPath finderPath = null;
1257 Object[] finderArgs = new Object[] { start, end, orderByComparator };
1258
1259 if ((start == QueryUtil.ALL_POS) && (end == QueryUtil.ALL_POS) &&
1260 (orderByComparator == null)) {
1261 finderPath = FINDER_PATH_WITH_PAGINATION_FIND_ALL;
1262 finderArgs = FINDER_ARGS_EMPTY;
1263 }
1264 else {
1265 finderPath = FINDER_PATH_WITHOUT_PAGINATION_FIND_ALL;
1266 finderArgs = new Object[] { start, end, orderByComparator };
1267 }
1268
1269 List<PasswordPolicyRel> list = (List<PasswordPolicyRel>)FinderCacheUtil.getResult(finderPath,
1270 finderArgs, this);
1271
1272 if (list == null) {
1273 StringBundler query = null;
1274 String sql = null;
1275
1276 if (orderByComparator != null) {
1277 query = new StringBundler(2 +
1278 (orderByComparator.getOrderByFields().length * 3));
1279
1280 query.append(_SQL_SELECT_PASSWORDPOLICYREL);
1281
1282 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
1283 orderByComparator);
1284
1285 sql = query.toString();
1286 }
1287 else {
1288 sql = _SQL_SELECT_PASSWORDPOLICYREL;
1289 }
1290
1291 Session session = null;
1292
1293 try {
1294 session = openSession();
1295
1296 Query q = session.createQuery(sql);
1297
1298 if (orderByComparator == null) {
1299 list = (List<PasswordPolicyRel>)QueryUtil.list(q,
1300 getDialect(), start, end, false);
1301
1302 Collections.sort(list);
1303 }
1304 else {
1305 list = (List<PasswordPolicyRel>)QueryUtil.list(q,
1306 getDialect(), start, end);
1307 }
1308 }
1309 catch (Exception e) {
1310 throw processException(e);
1311 }
1312 finally {
1313 if (list == null) {
1314 FinderCacheUtil.removeResult(finderPath, finderArgs);
1315 }
1316 else {
1317 cacheResult(list);
1318
1319 FinderCacheUtil.putResult(finderPath, finderArgs, list);
1320 }
1321
1322 closeSession(session);
1323 }
1324 }
1325
1326 return list;
1327 }
1328
1329
1335 public void removeByPasswordPolicyId(long passwordPolicyId)
1336 throws SystemException {
1337 for (PasswordPolicyRel passwordPolicyRel : findByPasswordPolicyId(
1338 passwordPolicyId)) {
1339 remove(passwordPolicyRel);
1340 }
1341 }
1342
1343
1350 public void removeByC_C(long classNameId, long classPK)
1351 throws NoSuchPasswordPolicyRelException, SystemException {
1352 PasswordPolicyRel passwordPolicyRel = findByC_C(classNameId, classPK);
1353
1354 remove(passwordPolicyRel);
1355 }
1356
1357
1365 public void removeByP_C_C(long passwordPolicyId, long classNameId,
1366 long classPK) throws NoSuchPasswordPolicyRelException, SystemException {
1367 PasswordPolicyRel passwordPolicyRel = findByP_C_C(passwordPolicyId,
1368 classNameId, classPK);
1369
1370 remove(passwordPolicyRel);
1371 }
1372
1373
1378 public void removeAll() throws SystemException {
1379 for (PasswordPolicyRel passwordPolicyRel : findAll()) {
1380 remove(passwordPolicyRel);
1381 }
1382 }
1383
1384
1391 public int countByPasswordPolicyId(long passwordPolicyId)
1392 throws SystemException {
1393 Object[] finderArgs = new Object[] { passwordPolicyId };
1394
1395 Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_PASSWORDPOLICYID,
1396 finderArgs, this);
1397
1398 if (count == null) {
1399 StringBundler query = new StringBundler(2);
1400
1401 query.append(_SQL_COUNT_PASSWORDPOLICYREL_WHERE);
1402
1403 query.append(_FINDER_COLUMN_PASSWORDPOLICYID_PASSWORDPOLICYID_2);
1404
1405 String sql = query.toString();
1406
1407 Session session = null;
1408
1409 try {
1410 session = openSession();
1411
1412 Query q = session.createQuery(sql);
1413
1414 QueryPos qPos = QueryPos.getInstance(q);
1415
1416 qPos.add(passwordPolicyId);
1417
1418 count = (Long)q.uniqueResult();
1419 }
1420 catch (Exception e) {
1421 throw processException(e);
1422 }
1423 finally {
1424 if (count == null) {
1425 count = Long.valueOf(0);
1426 }
1427
1428 FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_PASSWORDPOLICYID,
1429 finderArgs, count);
1430
1431 closeSession(session);
1432 }
1433 }
1434
1435 return count.intValue();
1436 }
1437
1438
1446 public int countByC_C(long classNameId, long classPK)
1447 throws SystemException {
1448 Object[] finderArgs = new Object[] { classNameId, classPK };
1449
1450 Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_C_C,
1451 finderArgs, this);
1452
1453 if (count == null) {
1454 StringBundler query = new StringBundler(3);
1455
1456 query.append(_SQL_COUNT_PASSWORDPOLICYREL_WHERE);
1457
1458 query.append(_FINDER_COLUMN_C_C_CLASSNAMEID_2);
1459
1460 query.append(_FINDER_COLUMN_C_C_CLASSPK_2);
1461
1462 String sql = query.toString();
1463
1464 Session session = null;
1465
1466 try {
1467 session = openSession();
1468
1469 Query q = session.createQuery(sql);
1470
1471 QueryPos qPos = QueryPos.getInstance(q);
1472
1473 qPos.add(classNameId);
1474
1475 qPos.add(classPK);
1476
1477 count = (Long)q.uniqueResult();
1478 }
1479 catch (Exception e) {
1480 throw processException(e);
1481 }
1482 finally {
1483 if (count == null) {
1484 count = Long.valueOf(0);
1485 }
1486
1487 FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_C_C, finderArgs,
1488 count);
1489
1490 closeSession(session);
1491 }
1492 }
1493
1494 return count.intValue();
1495 }
1496
1497
1506 public int countByP_C_C(long passwordPolicyId, long classNameId,
1507 long classPK) throws SystemException {
1508 Object[] finderArgs = new Object[] {
1509 passwordPolicyId, classNameId, classPK
1510 };
1511
1512 Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_P_C_C,
1513 finderArgs, this);
1514
1515 if (count == null) {
1516 StringBundler query = new StringBundler(4);
1517
1518 query.append(_SQL_COUNT_PASSWORDPOLICYREL_WHERE);
1519
1520 query.append(_FINDER_COLUMN_P_C_C_PASSWORDPOLICYID_2);
1521
1522 query.append(_FINDER_COLUMN_P_C_C_CLASSNAMEID_2);
1523
1524 query.append(_FINDER_COLUMN_P_C_C_CLASSPK_2);
1525
1526 String sql = query.toString();
1527
1528 Session session = null;
1529
1530 try {
1531 session = openSession();
1532
1533 Query q = session.createQuery(sql);
1534
1535 QueryPos qPos = QueryPos.getInstance(q);
1536
1537 qPos.add(passwordPolicyId);
1538
1539 qPos.add(classNameId);
1540
1541 qPos.add(classPK);
1542
1543 count = (Long)q.uniqueResult();
1544 }
1545 catch (Exception e) {
1546 throw processException(e);
1547 }
1548 finally {
1549 if (count == null) {
1550 count = Long.valueOf(0);
1551 }
1552
1553 FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_P_C_C,
1554 finderArgs, count);
1555
1556 closeSession(session);
1557 }
1558 }
1559
1560 return count.intValue();
1561 }
1562
1563
1569 public int countAll() throws SystemException {
1570 Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_ALL,
1571 FINDER_ARGS_EMPTY, this);
1572
1573 if (count == null) {
1574 Session session = null;
1575
1576 try {
1577 session = openSession();
1578
1579 Query q = session.createQuery(_SQL_COUNT_PASSWORDPOLICYREL);
1580
1581 count = (Long)q.uniqueResult();
1582 }
1583 catch (Exception e) {
1584 throw processException(e);
1585 }
1586 finally {
1587 if (count == null) {
1588 count = Long.valueOf(0);
1589 }
1590
1591 FinderCacheUtil.putResult(FINDER_PATH_COUNT_ALL,
1592 FINDER_ARGS_EMPTY, count);
1593
1594 closeSession(session);
1595 }
1596 }
1597
1598 return count.intValue();
1599 }
1600
1601
1604 public void afterPropertiesSet() {
1605 String[] listenerClassNames = StringUtil.split(GetterUtil.getString(
1606 com.liferay.portal.util.PropsUtil.get(
1607 "value.object.listener.com.liferay.portal.model.PasswordPolicyRel")));
1608
1609 if (listenerClassNames.length > 0) {
1610 try {
1611 List<ModelListener<PasswordPolicyRel>> listenersList = new ArrayList<ModelListener<PasswordPolicyRel>>();
1612
1613 for (String listenerClassName : listenerClassNames) {
1614 listenersList.add((ModelListener<PasswordPolicyRel>)InstanceFactory.newInstance(
1615 listenerClassName));
1616 }
1617
1618 listeners = listenersList.toArray(new ModelListener[listenersList.size()]);
1619 }
1620 catch (Exception e) {
1621 _log.error(e);
1622 }
1623 }
1624 }
1625
1626 public void destroy() {
1627 EntityCacheUtil.removeCache(PasswordPolicyRelImpl.class.getName());
1628 FinderCacheUtil.removeCache(FINDER_CLASS_NAME_ENTITY);
1629 FinderCacheUtil.removeCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
1630 }
1631
1632 @BeanReference(type = AccountPersistence.class)
1633 protected AccountPersistence accountPersistence;
1634 @BeanReference(type = AddressPersistence.class)
1635 protected AddressPersistence addressPersistence;
1636 @BeanReference(type = BrowserTrackerPersistence.class)
1637 protected BrowserTrackerPersistence browserTrackerPersistence;
1638 @BeanReference(type = ClassNamePersistence.class)
1639 protected ClassNamePersistence classNamePersistence;
1640 @BeanReference(type = ClusterGroupPersistence.class)
1641 protected ClusterGroupPersistence clusterGroupPersistence;
1642 @BeanReference(type = CompanyPersistence.class)
1643 protected CompanyPersistence companyPersistence;
1644 @BeanReference(type = ContactPersistence.class)
1645 protected ContactPersistence contactPersistence;
1646 @BeanReference(type = CountryPersistence.class)
1647 protected CountryPersistence countryPersistence;
1648 @BeanReference(type = EmailAddressPersistence.class)
1649 protected EmailAddressPersistence emailAddressPersistence;
1650 @BeanReference(type = GroupPersistence.class)
1651 protected GroupPersistence groupPersistence;
1652 @BeanReference(type = ImagePersistence.class)
1653 protected ImagePersistence imagePersistence;
1654 @BeanReference(type = LayoutPersistence.class)
1655 protected LayoutPersistence layoutPersistence;
1656 @BeanReference(type = LayoutBranchPersistence.class)
1657 protected LayoutBranchPersistence layoutBranchPersistence;
1658 @BeanReference(type = LayoutPrototypePersistence.class)
1659 protected LayoutPrototypePersistence layoutPrototypePersistence;
1660 @BeanReference(type = LayoutRevisionPersistence.class)
1661 protected LayoutRevisionPersistence layoutRevisionPersistence;
1662 @BeanReference(type = LayoutSetPersistence.class)
1663 protected LayoutSetPersistence layoutSetPersistence;
1664 @BeanReference(type = LayoutSetBranchPersistence.class)
1665 protected LayoutSetBranchPersistence layoutSetBranchPersistence;
1666 @BeanReference(type = LayoutSetPrototypePersistence.class)
1667 protected LayoutSetPrototypePersistence layoutSetPrototypePersistence;
1668 @BeanReference(type = ListTypePersistence.class)
1669 protected ListTypePersistence listTypePersistence;
1670 @BeanReference(type = LockPersistence.class)
1671 protected LockPersistence lockPersistence;
1672 @BeanReference(type = MembershipRequestPersistence.class)
1673 protected MembershipRequestPersistence membershipRequestPersistence;
1674 @BeanReference(type = OrganizationPersistence.class)
1675 protected OrganizationPersistence organizationPersistence;
1676 @BeanReference(type = OrgGroupPermissionPersistence.class)
1677 protected OrgGroupPermissionPersistence orgGroupPermissionPersistence;
1678 @BeanReference(type = OrgGroupRolePersistence.class)
1679 protected OrgGroupRolePersistence orgGroupRolePersistence;
1680 @BeanReference(type = OrgLaborPersistence.class)
1681 protected OrgLaborPersistence orgLaborPersistence;
1682 @BeanReference(type = PasswordPolicyPersistence.class)
1683 protected PasswordPolicyPersistence passwordPolicyPersistence;
1684 @BeanReference(type = PasswordPolicyRelPersistence.class)
1685 protected PasswordPolicyRelPersistence passwordPolicyRelPersistence;
1686 @BeanReference(type = PasswordTrackerPersistence.class)
1687 protected PasswordTrackerPersistence passwordTrackerPersistence;
1688 @BeanReference(type = PermissionPersistence.class)
1689 protected PermissionPersistence permissionPersistence;
1690 @BeanReference(type = PhonePersistence.class)
1691 protected PhonePersistence phonePersistence;
1692 @BeanReference(type = PluginSettingPersistence.class)
1693 protected PluginSettingPersistence pluginSettingPersistence;
1694 @BeanReference(type = PortalPreferencesPersistence.class)
1695 protected PortalPreferencesPersistence portalPreferencesPersistence;
1696 @BeanReference(type = PortletPersistence.class)
1697 protected PortletPersistence portletPersistence;
1698 @BeanReference(type = PortletItemPersistence.class)
1699 protected PortletItemPersistence portletItemPersistence;
1700 @BeanReference(type = PortletPreferencesPersistence.class)
1701 protected PortletPreferencesPersistence portletPreferencesPersistence;
1702 @BeanReference(type = RegionPersistence.class)
1703 protected RegionPersistence regionPersistence;
1704 @BeanReference(type = ReleasePersistence.class)
1705 protected ReleasePersistence releasePersistence;
1706 @BeanReference(type = RepositoryPersistence.class)
1707 protected RepositoryPersistence repositoryPersistence;
1708 @BeanReference(type = RepositoryEntryPersistence.class)
1709 protected RepositoryEntryPersistence repositoryEntryPersistence;
1710 @BeanReference(type = ResourcePersistence.class)
1711 protected ResourcePersistence resourcePersistence;
1712 @BeanReference(type = ResourceActionPersistence.class)
1713 protected ResourceActionPersistence resourceActionPersistence;
1714 @BeanReference(type = ResourceBlockPersistence.class)
1715 protected ResourceBlockPersistence resourceBlockPersistence;
1716 @BeanReference(type = ResourceBlockPermissionPersistence.class)
1717 protected ResourceBlockPermissionPersistence resourceBlockPermissionPersistence;
1718 @BeanReference(type = ResourceCodePersistence.class)
1719 protected ResourceCodePersistence resourceCodePersistence;
1720 @BeanReference(type = ResourcePermissionPersistence.class)
1721 protected ResourcePermissionPersistence resourcePermissionPersistence;
1722 @BeanReference(type = ResourceTypePermissionPersistence.class)
1723 protected ResourceTypePermissionPersistence resourceTypePermissionPersistence;
1724 @BeanReference(type = RolePersistence.class)
1725 protected RolePersistence rolePersistence;
1726 @BeanReference(type = ServiceComponentPersistence.class)
1727 protected ServiceComponentPersistence serviceComponentPersistence;
1728 @BeanReference(type = ShardPersistence.class)
1729 protected ShardPersistence shardPersistence;
1730 @BeanReference(type = SubscriptionPersistence.class)
1731 protected SubscriptionPersistence subscriptionPersistence;
1732 @BeanReference(type = TeamPersistence.class)
1733 protected TeamPersistence teamPersistence;
1734 @BeanReference(type = TicketPersistence.class)
1735 protected TicketPersistence ticketPersistence;
1736 @BeanReference(type = UserPersistence.class)
1737 protected UserPersistence userPersistence;
1738 @BeanReference(type = UserGroupPersistence.class)
1739 protected UserGroupPersistence userGroupPersistence;
1740 @BeanReference(type = UserGroupGroupRolePersistence.class)
1741 protected UserGroupGroupRolePersistence userGroupGroupRolePersistence;
1742 @BeanReference(type = UserGroupRolePersistence.class)
1743 protected UserGroupRolePersistence userGroupRolePersistence;
1744 @BeanReference(type = UserIdMapperPersistence.class)
1745 protected UserIdMapperPersistence userIdMapperPersistence;
1746 @BeanReference(type = UserNotificationEventPersistence.class)
1747 protected UserNotificationEventPersistence userNotificationEventPersistence;
1748 @BeanReference(type = UserTrackerPersistence.class)
1749 protected UserTrackerPersistence userTrackerPersistence;
1750 @BeanReference(type = UserTrackerPathPersistence.class)
1751 protected UserTrackerPathPersistence userTrackerPathPersistence;
1752 @BeanReference(type = VirtualHostPersistence.class)
1753 protected VirtualHostPersistence virtualHostPersistence;
1754 @BeanReference(type = WebDAVPropsPersistence.class)
1755 protected WebDAVPropsPersistence webDAVPropsPersistence;
1756 @BeanReference(type = WebsitePersistence.class)
1757 protected WebsitePersistence websitePersistence;
1758 @BeanReference(type = WorkflowDefinitionLinkPersistence.class)
1759 protected WorkflowDefinitionLinkPersistence workflowDefinitionLinkPersistence;
1760 @BeanReference(type = WorkflowInstanceLinkPersistence.class)
1761 protected WorkflowInstanceLinkPersistence workflowInstanceLinkPersistence;
1762 private static final String _SQL_SELECT_PASSWORDPOLICYREL = "SELECT passwordPolicyRel FROM PasswordPolicyRel passwordPolicyRel";
1763 private static final String _SQL_SELECT_PASSWORDPOLICYREL_WHERE = "SELECT passwordPolicyRel FROM PasswordPolicyRel passwordPolicyRel WHERE ";
1764 private static final String _SQL_COUNT_PASSWORDPOLICYREL = "SELECT COUNT(passwordPolicyRel) FROM PasswordPolicyRel passwordPolicyRel";
1765 private static final String _SQL_COUNT_PASSWORDPOLICYREL_WHERE = "SELECT COUNT(passwordPolicyRel) FROM PasswordPolicyRel passwordPolicyRel WHERE ";
1766 private static final String _FINDER_COLUMN_PASSWORDPOLICYID_PASSWORDPOLICYID_2 =
1767 "passwordPolicyRel.passwordPolicyId = ?";
1768 private static final String _FINDER_COLUMN_C_C_CLASSNAMEID_2 = "passwordPolicyRel.classNameId = ? AND ";
1769 private static final String _FINDER_COLUMN_C_C_CLASSPK_2 = "passwordPolicyRel.classPK = ?";
1770 private static final String _FINDER_COLUMN_P_C_C_PASSWORDPOLICYID_2 = "passwordPolicyRel.passwordPolicyId = ? AND ";
1771 private static final String _FINDER_COLUMN_P_C_C_CLASSNAMEID_2 = "passwordPolicyRel.classNameId = ? AND ";
1772 private static final String _FINDER_COLUMN_P_C_C_CLASSPK_2 = "passwordPolicyRel.classPK = ?";
1773 private static final String _ORDER_BY_ENTITY_ALIAS = "passwordPolicyRel.";
1774 private static final String _NO_SUCH_ENTITY_WITH_PRIMARY_KEY = "No PasswordPolicyRel exists with the primary key ";
1775 private static final String _NO_SUCH_ENTITY_WITH_KEY = "No PasswordPolicyRel exists with the key {";
1776 private static final boolean _HIBERNATE_CACHE_USE_SECOND_LEVEL_CACHE = com.liferay.portal.util.PropsValues.HIBERNATE_CACHE_USE_SECOND_LEVEL_CACHE;
1777 private static Log _log = LogFactoryUtil.getLog(PasswordPolicyRelPersistenceImpl.class);
1778 private static PasswordPolicyRel _nullPasswordPolicyRel = new PasswordPolicyRelImpl() {
1779 @Override
1780 public Object clone() {
1781 return this;
1782 }
1783
1784 @Override
1785 public CacheModel<PasswordPolicyRel> toCacheModel() {
1786 return _nullPasswordPolicyRelCacheModel;
1787 }
1788 };
1789
1790 private static CacheModel<PasswordPolicyRel> _nullPasswordPolicyRelCacheModel =
1791 new CacheModel<PasswordPolicyRel>() {
1792 public PasswordPolicyRel toEntityModel() {
1793 return _nullPasswordPolicyRel;
1794 }
1795 };
1796 }