001
014
015 package com.liferay.portal.service.persistence.impl;
016
017 import aQute.bnd.annotation.ProviderType;
018
019 import com.liferay.portal.exception.NoSuchPasswordPolicyRelException;
020 import com.liferay.portal.kernel.bean.BeanReference;
021 import com.liferay.portal.kernel.dao.orm.EntityCache;
022 import com.liferay.portal.kernel.dao.orm.EntityCacheUtil;
023 import com.liferay.portal.kernel.dao.orm.FinderCache;
024 import com.liferay.portal.kernel.dao.orm.FinderCacheUtil;
025 import com.liferay.portal.kernel.dao.orm.FinderPath;
026 import com.liferay.portal.kernel.dao.orm.Query;
027 import com.liferay.portal.kernel.dao.orm.QueryPos;
028 import com.liferay.portal.kernel.dao.orm.QueryUtil;
029 import com.liferay.portal.kernel.dao.orm.Session;
030 import com.liferay.portal.kernel.log.Log;
031 import com.liferay.portal.kernel.log.LogFactoryUtil;
032 import com.liferay.portal.kernel.util.OrderByComparator;
033 import com.liferay.portal.kernel.util.StringBundler;
034 import com.liferay.portal.kernel.util.StringPool;
035 import com.liferay.portal.model.CacheModel;
036 import com.liferay.portal.model.MVCCModel;
037 import com.liferay.portal.model.PasswordPolicyRel;
038 import com.liferay.portal.model.impl.PasswordPolicyRelImpl;
039 import com.liferay.portal.model.impl.PasswordPolicyRelModelImpl;
040 import com.liferay.portal.service.persistence.CompanyProvider;
041 import com.liferay.portal.service.persistence.CompanyProviderWrapper;
042 import com.liferay.portal.service.persistence.PasswordPolicyRelPersistence;
043
044 import java.io.Serializable;
045
046 import java.util.Collections;
047 import java.util.HashMap;
048 import java.util.HashSet;
049 import java.util.Iterator;
050 import java.util.List;
051 import java.util.Map;
052 import java.util.Set;
053
054
066 @ProviderType
067 public class PasswordPolicyRelPersistenceImpl extends BasePersistenceImpl<PasswordPolicyRel>
068 implements PasswordPolicyRelPersistence {
069
074 public static final String FINDER_CLASS_NAME_ENTITY = PasswordPolicyRelImpl.class.getName();
075 public static final String FINDER_CLASS_NAME_LIST_WITH_PAGINATION = FINDER_CLASS_NAME_ENTITY +
076 ".List1";
077 public static final String FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION = FINDER_CLASS_NAME_ENTITY +
078 ".List2";
079 public static final FinderPath FINDER_PATH_WITH_PAGINATION_FIND_ALL = new FinderPath(PasswordPolicyRelModelImpl.ENTITY_CACHE_ENABLED,
080 PasswordPolicyRelModelImpl.FINDER_CACHE_ENABLED,
081 PasswordPolicyRelImpl.class,
082 FINDER_CLASS_NAME_LIST_WITH_PAGINATION, "findAll", new String[0]);
083 public static final FinderPath FINDER_PATH_WITHOUT_PAGINATION_FIND_ALL = new FinderPath(PasswordPolicyRelModelImpl.ENTITY_CACHE_ENABLED,
084 PasswordPolicyRelModelImpl.FINDER_CACHE_ENABLED,
085 PasswordPolicyRelImpl.class,
086 FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "findAll", new String[0]);
087 public static final FinderPath FINDER_PATH_COUNT_ALL = new FinderPath(PasswordPolicyRelModelImpl.ENTITY_CACHE_ENABLED,
088 PasswordPolicyRelModelImpl.FINDER_CACHE_ENABLED, Long.class,
089 FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "countAll", new String[0]);
090 public static final FinderPath FINDER_PATH_WITH_PAGINATION_FIND_BY_PASSWORDPOLICYID =
091 new FinderPath(PasswordPolicyRelModelImpl.ENTITY_CACHE_ENABLED,
092 PasswordPolicyRelModelImpl.FINDER_CACHE_ENABLED,
093 PasswordPolicyRelImpl.class,
094 FINDER_CLASS_NAME_LIST_WITH_PAGINATION, "findByPasswordPolicyId",
095 new String[] {
096 Long.class.getName(),
097
098 Integer.class.getName(), Integer.class.getName(),
099 OrderByComparator.class.getName()
100 });
101 public static final FinderPath FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_PASSWORDPOLICYID =
102 new FinderPath(PasswordPolicyRelModelImpl.ENTITY_CACHE_ENABLED,
103 PasswordPolicyRelModelImpl.FINDER_CACHE_ENABLED,
104 PasswordPolicyRelImpl.class,
105 FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION,
106 "findByPasswordPolicyId", new String[] { Long.class.getName() },
107 PasswordPolicyRelModelImpl.PASSWORDPOLICYID_COLUMN_BITMASK);
108 public static final FinderPath FINDER_PATH_COUNT_BY_PASSWORDPOLICYID = new FinderPath(PasswordPolicyRelModelImpl.ENTITY_CACHE_ENABLED,
109 PasswordPolicyRelModelImpl.FINDER_CACHE_ENABLED, Long.class,
110 FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION,
111 "countByPasswordPolicyId", new String[] { Long.class.getName() });
112
113
119 @Override
120 public List<PasswordPolicyRel> findByPasswordPolicyId(long passwordPolicyId) {
121 return findByPasswordPolicyId(passwordPolicyId, QueryUtil.ALL_POS,
122 QueryUtil.ALL_POS, null);
123 }
124
125
137 @Override
138 public List<PasswordPolicyRel> findByPasswordPolicyId(
139 long passwordPolicyId, int start, int end) {
140 return findByPasswordPolicyId(passwordPolicyId, start, end, null);
141 }
142
143
156 @Override
157 public List<PasswordPolicyRel> findByPasswordPolicyId(
158 long passwordPolicyId, int start, int end,
159 OrderByComparator<PasswordPolicyRel> orderByComparator) {
160 return findByPasswordPolicyId(passwordPolicyId, start, end,
161 orderByComparator, true);
162 }
163
164
178 @Override
179 public List<PasswordPolicyRel> findByPasswordPolicyId(
180 long passwordPolicyId, int start, int end,
181 OrderByComparator<PasswordPolicyRel> orderByComparator,
182 boolean retrieveFromCache) {
183 boolean pagination = true;
184 FinderPath finderPath = null;
185 Object[] finderArgs = null;
186
187 if ((start == QueryUtil.ALL_POS) && (end == QueryUtil.ALL_POS) &&
188 (orderByComparator == null)) {
189 pagination = false;
190 finderPath = FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_PASSWORDPOLICYID;
191 finderArgs = new Object[] { passwordPolicyId };
192 }
193 else {
194 finderPath = FINDER_PATH_WITH_PAGINATION_FIND_BY_PASSWORDPOLICYID;
195 finderArgs = new Object[] {
196 passwordPolicyId,
197
198 start, end, orderByComparator
199 };
200 }
201
202 List<PasswordPolicyRel> list = null;
203
204 if (retrieveFromCache) {
205 list = (List<PasswordPolicyRel>)finderCache.getResult(finderPath,
206 finderArgs, this);
207
208 if ((list != null) && !list.isEmpty()) {
209 for (PasswordPolicyRel passwordPolicyRel : list) {
210 if ((passwordPolicyId != passwordPolicyRel.getPasswordPolicyId())) {
211 list = null;
212
213 break;
214 }
215 }
216 }
217 }
218
219 if (list == null) {
220 StringBundler query = null;
221
222 if (orderByComparator != null) {
223 query = new StringBundler(3 +
224 (orderByComparator.getOrderByFields().length * 2));
225 }
226 else {
227 query = new StringBundler(3);
228 }
229
230 query.append(_SQL_SELECT_PASSWORDPOLICYREL_WHERE);
231
232 query.append(_FINDER_COLUMN_PASSWORDPOLICYID_PASSWORDPOLICYID_2);
233
234 if (orderByComparator != null) {
235 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
236 orderByComparator);
237 }
238 else
239 if (pagination) {
240 query.append(PasswordPolicyRelModelImpl.ORDER_BY_JPQL);
241 }
242
243 String sql = query.toString();
244
245 Session session = null;
246
247 try {
248 session = openSession();
249
250 Query q = session.createQuery(sql);
251
252 QueryPos qPos = QueryPos.getInstance(q);
253
254 qPos.add(passwordPolicyId);
255
256 if (!pagination) {
257 list = (List<PasswordPolicyRel>)QueryUtil.list(q,
258 getDialect(), start, end, false);
259
260 Collections.sort(list);
261
262 list = Collections.unmodifiableList(list);
263 }
264 else {
265 list = (List<PasswordPolicyRel>)QueryUtil.list(q,
266 getDialect(), start, end);
267 }
268
269 cacheResult(list);
270
271 finderCache.putResult(finderPath, finderArgs, list);
272 }
273 catch (Exception e) {
274 finderCache.removeResult(finderPath, finderArgs);
275
276 throw processException(e);
277 }
278 finally {
279 closeSession(session);
280 }
281 }
282
283 return list;
284 }
285
286
294 @Override
295 public PasswordPolicyRel findByPasswordPolicyId_First(
296 long passwordPolicyId,
297 OrderByComparator<PasswordPolicyRel> orderByComparator)
298 throws NoSuchPasswordPolicyRelException {
299 PasswordPolicyRel passwordPolicyRel = fetchByPasswordPolicyId_First(passwordPolicyId,
300 orderByComparator);
301
302 if (passwordPolicyRel != null) {
303 return passwordPolicyRel;
304 }
305
306 StringBundler msg = new StringBundler(4);
307
308 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
309
310 msg.append("passwordPolicyId=");
311 msg.append(passwordPolicyId);
312
313 msg.append(StringPool.CLOSE_CURLY_BRACE);
314
315 throw new NoSuchPasswordPolicyRelException(msg.toString());
316 }
317
318
325 @Override
326 public PasswordPolicyRel fetchByPasswordPolicyId_First(
327 long passwordPolicyId,
328 OrderByComparator<PasswordPolicyRel> orderByComparator) {
329 List<PasswordPolicyRel> list = findByPasswordPolicyId(passwordPolicyId,
330 0, 1, orderByComparator);
331
332 if (!list.isEmpty()) {
333 return list.get(0);
334 }
335
336 return null;
337 }
338
339
347 @Override
348 public PasswordPolicyRel findByPasswordPolicyId_Last(
349 long passwordPolicyId,
350 OrderByComparator<PasswordPolicyRel> orderByComparator)
351 throws NoSuchPasswordPolicyRelException {
352 PasswordPolicyRel passwordPolicyRel = fetchByPasswordPolicyId_Last(passwordPolicyId,
353 orderByComparator);
354
355 if (passwordPolicyRel != null) {
356 return passwordPolicyRel;
357 }
358
359 StringBundler msg = new StringBundler(4);
360
361 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
362
363 msg.append("passwordPolicyId=");
364 msg.append(passwordPolicyId);
365
366 msg.append(StringPool.CLOSE_CURLY_BRACE);
367
368 throw new NoSuchPasswordPolicyRelException(msg.toString());
369 }
370
371
378 @Override
379 public PasswordPolicyRel fetchByPasswordPolicyId_Last(
380 long passwordPolicyId,
381 OrderByComparator<PasswordPolicyRel> orderByComparator) {
382 int count = countByPasswordPolicyId(passwordPolicyId);
383
384 if (count == 0) {
385 return null;
386 }
387
388 List<PasswordPolicyRel> list = findByPasswordPolicyId(passwordPolicyId,
389 count - 1, count, orderByComparator);
390
391 if (!list.isEmpty()) {
392 return list.get(0);
393 }
394
395 return null;
396 }
397
398
407 @Override
408 public PasswordPolicyRel[] findByPasswordPolicyId_PrevAndNext(
409 long passwordPolicyRelId, long passwordPolicyId,
410 OrderByComparator<PasswordPolicyRel> orderByComparator)
411 throws NoSuchPasswordPolicyRelException {
412 PasswordPolicyRel passwordPolicyRel = findByPrimaryKey(passwordPolicyRelId);
413
414 Session session = null;
415
416 try {
417 session = openSession();
418
419 PasswordPolicyRel[] array = new PasswordPolicyRelImpl[3];
420
421 array[0] = getByPasswordPolicyId_PrevAndNext(session,
422 passwordPolicyRel, passwordPolicyId, orderByComparator, true);
423
424 array[1] = passwordPolicyRel;
425
426 array[2] = getByPasswordPolicyId_PrevAndNext(session,
427 passwordPolicyRel, passwordPolicyId, orderByComparator,
428 false);
429
430 return array;
431 }
432 catch (Exception e) {
433 throw processException(e);
434 }
435 finally {
436 closeSession(session);
437 }
438 }
439
440 protected PasswordPolicyRel getByPasswordPolicyId_PrevAndNext(
441 Session session, PasswordPolicyRel passwordPolicyRel,
442 long passwordPolicyId,
443 OrderByComparator<PasswordPolicyRel> orderByComparator, boolean previous) {
444 StringBundler query = null;
445
446 if (orderByComparator != null) {
447 query = new StringBundler(4 +
448 (orderByComparator.getOrderByConditionFields().length * 3) +
449 (orderByComparator.getOrderByFields().length * 3));
450 }
451 else {
452 query = new StringBundler(3);
453 }
454
455 query.append(_SQL_SELECT_PASSWORDPOLICYREL_WHERE);
456
457 query.append(_FINDER_COLUMN_PASSWORDPOLICYID_PASSWORDPOLICYID_2);
458
459 if (orderByComparator != null) {
460 String[] orderByConditionFields = orderByComparator.getOrderByConditionFields();
461
462 if (orderByConditionFields.length > 0) {
463 query.append(WHERE_AND);
464 }
465
466 for (int i = 0; i < orderByConditionFields.length; i++) {
467 query.append(_ORDER_BY_ENTITY_ALIAS);
468 query.append(orderByConditionFields[i]);
469
470 if ((i + 1) < orderByConditionFields.length) {
471 if (orderByComparator.isAscending() ^ previous) {
472 query.append(WHERE_GREATER_THAN_HAS_NEXT);
473 }
474 else {
475 query.append(WHERE_LESSER_THAN_HAS_NEXT);
476 }
477 }
478 else {
479 if (orderByComparator.isAscending() ^ previous) {
480 query.append(WHERE_GREATER_THAN);
481 }
482 else {
483 query.append(WHERE_LESSER_THAN);
484 }
485 }
486 }
487
488 query.append(ORDER_BY_CLAUSE);
489
490 String[] orderByFields = orderByComparator.getOrderByFields();
491
492 for (int i = 0; i < orderByFields.length; i++) {
493 query.append(_ORDER_BY_ENTITY_ALIAS);
494 query.append(orderByFields[i]);
495
496 if ((i + 1) < orderByFields.length) {
497 if (orderByComparator.isAscending() ^ previous) {
498 query.append(ORDER_BY_ASC_HAS_NEXT);
499 }
500 else {
501 query.append(ORDER_BY_DESC_HAS_NEXT);
502 }
503 }
504 else {
505 if (orderByComparator.isAscending() ^ previous) {
506 query.append(ORDER_BY_ASC);
507 }
508 else {
509 query.append(ORDER_BY_DESC);
510 }
511 }
512 }
513 }
514 else {
515 query.append(PasswordPolicyRelModelImpl.ORDER_BY_JPQL);
516 }
517
518 String sql = query.toString();
519
520 Query q = session.createQuery(sql);
521
522 q.setFirstResult(0);
523 q.setMaxResults(2);
524
525 QueryPos qPos = QueryPos.getInstance(q);
526
527 qPos.add(passwordPolicyId);
528
529 if (orderByComparator != null) {
530 Object[] values = orderByComparator.getOrderByConditionValues(passwordPolicyRel);
531
532 for (Object value : values) {
533 qPos.add(value);
534 }
535 }
536
537 List<PasswordPolicyRel> list = q.list();
538
539 if (list.size() == 2) {
540 return list.get(1);
541 }
542 else {
543 return null;
544 }
545 }
546
547
552 @Override
553 public void removeByPasswordPolicyId(long passwordPolicyId) {
554 for (PasswordPolicyRel passwordPolicyRel : findByPasswordPolicyId(
555 passwordPolicyId, QueryUtil.ALL_POS, QueryUtil.ALL_POS, null)) {
556 remove(passwordPolicyRel);
557 }
558 }
559
560
566 @Override
567 public int countByPasswordPolicyId(long passwordPolicyId) {
568 FinderPath finderPath = FINDER_PATH_COUNT_BY_PASSWORDPOLICYID;
569
570 Object[] finderArgs = new Object[] { passwordPolicyId };
571
572 Long count = (Long)finderCache.getResult(finderPath, finderArgs, this);
573
574 if (count == null) {
575 StringBundler query = new StringBundler(2);
576
577 query.append(_SQL_COUNT_PASSWORDPOLICYREL_WHERE);
578
579 query.append(_FINDER_COLUMN_PASSWORDPOLICYID_PASSWORDPOLICYID_2);
580
581 String sql = query.toString();
582
583 Session session = null;
584
585 try {
586 session = openSession();
587
588 Query q = session.createQuery(sql);
589
590 QueryPos qPos = QueryPos.getInstance(q);
591
592 qPos.add(passwordPolicyId);
593
594 count = (Long)q.uniqueResult();
595
596 finderCache.putResult(finderPath, finderArgs, count);
597 }
598 catch (Exception e) {
599 finderCache.removeResult(finderPath, finderArgs);
600
601 throw processException(e);
602 }
603 finally {
604 closeSession(session);
605 }
606 }
607
608 return count.intValue();
609 }
610
611 private static final String _FINDER_COLUMN_PASSWORDPOLICYID_PASSWORDPOLICYID_2 =
612 "passwordPolicyRel.passwordPolicyId = ?";
613 public static final FinderPath FINDER_PATH_FETCH_BY_C_C = new FinderPath(PasswordPolicyRelModelImpl.ENTITY_CACHE_ENABLED,
614 PasswordPolicyRelModelImpl.FINDER_CACHE_ENABLED,
615 PasswordPolicyRelImpl.class, FINDER_CLASS_NAME_ENTITY,
616 "fetchByC_C",
617 new String[] { Long.class.getName(), Long.class.getName() },
618 PasswordPolicyRelModelImpl.CLASSNAMEID_COLUMN_BITMASK |
619 PasswordPolicyRelModelImpl.CLASSPK_COLUMN_BITMASK);
620 public static final FinderPath FINDER_PATH_COUNT_BY_C_C = new FinderPath(PasswordPolicyRelModelImpl.ENTITY_CACHE_ENABLED,
621 PasswordPolicyRelModelImpl.FINDER_CACHE_ENABLED, Long.class,
622 FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "countByC_C",
623 new String[] { Long.class.getName(), Long.class.getName() });
624
625
633 @Override
634 public PasswordPolicyRel findByC_C(long classNameId, long classPK)
635 throws NoSuchPasswordPolicyRelException {
636 PasswordPolicyRel passwordPolicyRel = fetchByC_C(classNameId, classPK);
637
638 if (passwordPolicyRel == null) {
639 StringBundler msg = new StringBundler(6);
640
641 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
642
643 msg.append("classNameId=");
644 msg.append(classNameId);
645
646 msg.append(", classPK=");
647 msg.append(classPK);
648
649 msg.append(StringPool.CLOSE_CURLY_BRACE);
650
651 if (_log.isWarnEnabled()) {
652 _log.warn(msg.toString());
653 }
654
655 throw new NoSuchPasswordPolicyRelException(msg.toString());
656 }
657
658 return passwordPolicyRel;
659 }
660
661
668 @Override
669 public PasswordPolicyRel fetchByC_C(long classNameId, long classPK) {
670 return fetchByC_C(classNameId, classPK, true);
671 }
672
673
681 @Override
682 public PasswordPolicyRel fetchByC_C(long classNameId, long classPK,
683 boolean retrieveFromCache) {
684 Object[] finderArgs = new Object[] { classNameId, classPK };
685
686 Object result = null;
687
688 if (retrieveFromCache) {
689 result = finderCache.getResult(FINDER_PATH_FETCH_BY_C_C,
690 finderArgs, this);
691 }
692
693 if (result instanceof PasswordPolicyRel) {
694 PasswordPolicyRel passwordPolicyRel = (PasswordPolicyRel)result;
695
696 if ((classNameId != passwordPolicyRel.getClassNameId()) ||
697 (classPK != passwordPolicyRel.getClassPK())) {
698 result = null;
699 }
700 }
701
702 if (result == null) {
703 StringBundler query = new StringBundler(4);
704
705 query.append(_SQL_SELECT_PASSWORDPOLICYREL_WHERE);
706
707 query.append(_FINDER_COLUMN_C_C_CLASSNAMEID_2);
708
709 query.append(_FINDER_COLUMN_C_C_CLASSPK_2);
710
711 String sql = query.toString();
712
713 Session session = null;
714
715 try {
716 session = openSession();
717
718 Query q = session.createQuery(sql);
719
720 QueryPos qPos = QueryPos.getInstance(q);
721
722 qPos.add(classNameId);
723
724 qPos.add(classPK);
725
726 List<PasswordPolicyRel> list = q.list();
727
728 if (list.isEmpty()) {
729 finderCache.putResult(FINDER_PATH_FETCH_BY_C_C, finderArgs,
730 list);
731 }
732 else {
733 PasswordPolicyRel passwordPolicyRel = list.get(0);
734
735 result = passwordPolicyRel;
736
737 cacheResult(passwordPolicyRel);
738
739 if ((passwordPolicyRel.getClassNameId() != classNameId) ||
740 (passwordPolicyRel.getClassPK() != classPK)) {
741 finderCache.putResult(FINDER_PATH_FETCH_BY_C_C,
742 finderArgs, passwordPolicyRel);
743 }
744 }
745 }
746 catch (Exception e) {
747 finderCache.removeResult(FINDER_PATH_FETCH_BY_C_C, finderArgs);
748
749 throw processException(e);
750 }
751 finally {
752 closeSession(session);
753 }
754 }
755
756 if (result instanceof List<?>) {
757 return null;
758 }
759 else {
760 return (PasswordPolicyRel)result;
761 }
762 }
763
764
771 @Override
772 public PasswordPolicyRel removeByC_C(long classNameId, long classPK)
773 throws NoSuchPasswordPolicyRelException {
774 PasswordPolicyRel passwordPolicyRel = findByC_C(classNameId, classPK);
775
776 return remove(passwordPolicyRel);
777 }
778
779
786 @Override
787 public int countByC_C(long classNameId, long classPK) {
788 FinderPath finderPath = FINDER_PATH_COUNT_BY_C_C;
789
790 Object[] finderArgs = new Object[] { classNameId, classPK };
791
792 Long count = (Long)finderCache.getResult(finderPath, finderArgs, this);
793
794 if (count == null) {
795 StringBundler query = new StringBundler(3);
796
797 query.append(_SQL_COUNT_PASSWORDPOLICYREL_WHERE);
798
799 query.append(_FINDER_COLUMN_C_C_CLASSNAMEID_2);
800
801 query.append(_FINDER_COLUMN_C_C_CLASSPK_2);
802
803 String sql = query.toString();
804
805 Session session = null;
806
807 try {
808 session = openSession();
809
810 Query q = session.createQuery(sql);
811
812 QueryPos qPos = QueryPos.getInstance(q);
813
814 qPos.add(classNameId);
815
816 qPos.add(classPK);
817
818 count = (Long)q.uniqueResult();
819
820 finderCache.putResult(finderPath, finderArgs, count);
821 }
822 catch (Exception e) {
823 finderCache.removeResult(finderPath, finderArgs);
824
825 throw processException(e);
826 }
827 finally {
828 closeSession(session);
829 }
830 }
831
832 return count.intValue();
833 }
834
835 private static final String _FINDER_COLUMN_C_C_CLASSNAMEID_2 = "passwordPolicyRel.classNameId = ? AND ";
836 private static final String _FINDER_COLUMN_C_C_CLASSPK_2 = "passwordPolicyRel.classPK = ?";
837
838 public PasswordPolicyRelPersistenceImpl() {
839 setModelClass(PasswordPolicyRel.class);
840 }
841
842
847 @Override
848 public void cacheResult(PasswordPolicyRel passwordPolicyRel) {
849 entityCache.putResult(PasswordPolicyRelModelImpl.ENTITY_CACHE_ENABLED,
850 PasswordPolicyRelImpl.class, passwordPolicyRel.getPrimaryKey(),
851 passwordPolicyRel);
852
853 finderCache.putResult(FINDER_PATH_FETCH_BY_C_C,
854 new Object[] {
855 passwordPolicyRel.getClassNameId(),
856 passwordPolicyRel.getClassPK()
857 }, passwordPolicyRel);
858
859 passwordPolicyRel.resetOriginalValues();
860 }
861
862
867 @Override
868 public void cacheResult(List<PasswordPolicyRel> passwordPolicyRels) {
869 for (PasswordPolicyRel passwordPolicyRel : passwordPolicyRels) {
870 if (entityCache.getResult(
871 PasswordPolicyRelModelImpl.ENTITY_CACHE_ENABLED,
872 PasswordPolicyRelImpl.class,
873 passwordPolicyRel.getPrimaryKey()) == null) {
874 cacheResult(passwordPolicyRel);
875 }
876 else {
877 passwordPolicyRel.resetOriginalValues();
878 }
879 }
880 }
881
882
889 @Override
890 public void clearCache() {
891 entityCache.clearCache(PasswordPolicyRelImpl.class);
892
893 finderCache.clearCache(FINDER_CLASS_NAME_ENTITY);
894 finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
895 finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
896 }
897
898
905 @Override
906 public void clearCache(PasswordPolicyRel passwordPolicyRel) {
907 entityCache.removeResult(PasswordPolicyRelModelImpl.ENTITY_CACHE_ENABLED,
908 PasswordPolicyRelImpl.class, passwordPolicyRel.getPrimaryKey());
909
910 finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
911 finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
912
913 clearUniqueFindersCache((PasswordPolicyRelModelImpl)passwordPolicyRel);
914 }
915
916 @Override
917 public void clearCache(List<PasswordPolicyRel> passwordPolicyRels) {
918 finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
919 finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
920
921 for (PasswordPolicyRel passwordPolicyRel : passwordPolicyRels) {
922 entityCache.removeResult(PasswordPolicyRelModelImpl.ENTITY_CACHE_ENABLED,
923 PasswordPolicyRelImpl.class, passwordPolicyRel.getPrimaryKey());
924
925 clearUniqueFindersCache((PasswordPolicyRelModelImpl)passwordPolicyRel);
926 }
927 }
928
929 protected void cacheUniqueFindersCache(
930 PasswordPolicyRelModelImpl passwordPolicyRelModelImpl, boolean isNew) {
931 if (isNew) {
932 Object[] args = new Object[] {
933 passwordPolicyRelModelImpl.getClassNameId(),
934 passwordPolicyRelModelImpl.getClassPK()
935 };
936
937 finderCache.putResult(FINDER_PATH_COUNT_BY_C_C, args,
938 Long.valueOf(1));
939 finderCache.putResult(FINDER_PATH_FETCH_BY_C_C, args,
940 passwordPolicyRelModelImpl);
941 }
942 else {
943 if ((passwordPolicyRelModelImpl.getColumnBitmask() &
944 FINDER_PATH_FETCH_BY_C_C.getColumnBitmask()) != 0) {
945 Object[] args = new Object[] {
946 passwordPolicyRelModelImpl.getClassNameId(),
947 passwordPolicyRelModelImpl.getClassPK()
948 };
949
950 finderCache.putResult(FINDER_PATH_COUNT_BY_C_C, args,
951 Long.valueOf(1));
952 finderCache.putResult(FINDER_PATH_FETCH_BY_C_C, args,
953 passwordPolicyRelModelImpl);
954 }
955 }
956 }
957
958 protected void clearUniqueFindersCache(
959 PasswordPolicyRelModelImpl passwordPolicyRelModelImpl) {
960 Object[] args = new Object[] {
961 passwordPolicyRelModelImpl.getClassNameId(),
962 passwordPolicyRelModelImpl.getClassPK()
963 };
964
965 finderCache.removeResult(FINDER_PATH_COUNT_BY_C_C, args);
966 finderCache.removeResult(FINDER_PATH_FETCH_BY_C_C, args);
967
968 if ((passwordPolicyRelModelImpl.getColumnBitmask() &
969 FINDER_PATH_FETCH_BY_C_C.getColumnBitmask()) != 0) {
970 args = new Object[] {
971 passwordPolicyRelModelImpl.getOriginalClassNameId(),
972 passwordPolicyRelModelImpl.getOriginalClassPK()
973 };
974
975 finderCache.removeResult(FINDER_PATH_COUNT_BY_C_C, args);
976 finderCache.removeResult(FINDER_PATH_FETCH_BY_C_C, args);
977 }
978 }
979
980
986 @Override
987 public PasswordPolicyRel create(long passwordPolicyRelId) {
988 PasswordPolicyRel passwordPolicyRel = new PasswordPolicyRelImpl();
989
990 passwordPolicyRel.setNew(true);
991 passwordPolicyRel.setPrimaryKey(passwordPolicyRelId);
992
993 passwordPolicyRel.setCompanyId(companyProvider.getCompanyId());
994
995 return passwordPolicyRel;
996 }
997
998
1005 @Override
1006 public PasswordPolicyRel remove(long passwordPolicyRelId)
1007 throws NoSuchPasswordPolicyRelException {
1008 return remove((Serializable)passwordPolicyRelId);
1009 }
1010
1011
1018 @Override
1019 public PasswordPolicyRel remove(Serializable primaryKey)
1020 throws NoSuchPasswordPolicyRelException {
1021 Session session = null;
1022
1023 try {
1024 session = openSession();
1025
1026 PasswordPolicyRel passwordPolicyRel = (PasswordPolicyRel)session.get(PasswordPolicyRelImpl.class,
1027 primaryKey);
1028
1029 if (passwordPolicyRel == null) {
1030 if (_log.isWarnEnabled()) {
1031 _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey);
1032 }
1033
1034 throw new NoSuchPasswordPolicyRelException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
1035 primaryKey);
1036 }
1037
1038 return remove(passwordPolicyRel);
1039 }
1040 catch (NoSuchPasswordPolicyRelException nsee) {
1041 throw nsee;
1042 }
1043 catch (Exception e) {
1044 throw processException(e);
1045 }
1046 finally {
1047 closeSession(session);
1048 }
1049 }
1050
1051 @Override
1052 protected PasswordPolicyRel removeImpl(PasswordPolicyRel passwordPolicyRel) {
1053 passwordPolicyRel = toUnwrappedModel(passwordPolicyRel);
1054
1055 Session session = null;
1056
1057 try {
1058 session = openSession();
1059
1060 if (!session.contains(passwordPolicyRel)) {
1061 passwordPolicyRel = (PasswordPolicyRel)session.get(PasswordPolicyRelImpl.class,
1062 passwordPolicyRel.getPrimaryKeyObj());
1063 }
1064
1065 if (passwordPolicyRel != null) {
1066 session.delete(passwordPolicyRel);
1067 }
1068 }
1069 catch (Exception e) {
1070 throw processException(e);
1071 }
1072 finally {
1073 closeSession(session);
1074 }
1075
1076 if (passwordPolicyRel != null) {
1077 clearCache(passwordPolicyRel);
1078 }
1079
1080 return passwordPolicyRel;
1081 }
1082
1083 @Override
1084 public PasswordPolicyRel updateImpl(PasswordPolicyRel passwordPolicyRel) {
1085 passwordPolicyRel = toUnwrappedModel(passwordPolicyRel);
1086
1087 boolean isNew = passwordPolicyRel.isNew();
1088
1089 PasswordPolicyRelModelImpl passwordPolicyRelModelImpl = (PasswordPolicyRelModelImpl)passwordPolicyRel;
1090
1091 Session session = null;
1092
1093 try {
1094 session = openSession();
1095
1096 if (passwordPolicyRel.isNew()) {
1097 session.save(passwordPolicyRel);
1098
1099 passwordPolicyRel.setNew(false);
1100 }
1101 else {
1102 passwordPolicyRel = (PasswordPolicyRel)session.merge(passwordPolicyRel);
1103 }
1104 }
1105 catch (Exception e) {
1106 throw processException(e);
1107 }
1108 finally {
1109 closeSession(session);
1110 }
1111
1112 finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
1113
1114 if (isNew || !PasswordPolicyRelModelImpl.COLUMN_BITMASK_ENABLED) {
1115 finderCache.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
1116 }
1117
1118 else {
1119 if ((passwordPolicyRelModelImpl.getColumnBitmask() &
1120 FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_PASSWORDPOLICYID.getColumnBitmask()) != 0) {
1121 Object[] args = new Object[] {
1122 passwordPolicyRelModelImpl.getOriginalPasswordPolicyId()
1123 };
1124
1125 finderCache.removeResult(FINDER_PATH_COUNT_BY_PASSWORDPOLICYID,
1126 args);
1127 finderCache.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_PASSWORDPOLICYID,
1128 args);
1129
1130 args = new Object[] {
1131 passwordPolicyRelModelImpl.getPasswordPolicyId()
1132 };
1133
1134 finderCache.removeResult(FINDER_PATH_COUNT_BY_PASSWORDPOLICYID,
1135 args);
1136 finderCache.removeResult(FINDER_PATH_WITHOUT_PAGINATION_FIND_BY_PASSWORDPOLICYID,
1137 args);
1138 }
1139 }
1140
1141 entityCache.putResult(PasswordPolicyRelModelImpl.ENTITY_CACHE_ENABLED,
1142 PasswordPolicyRelImpl.class, passwordPolicyRel.getPrimaryKey(),
1143 passwordPolicyRel, false);
1144
1145 clearUniqueFindersCache(passwordPolicyRelModelImpl);
1146 cacheUniqueFindersCache(passwordPolicyRelModelImpl, isNew);
1147
1148 passwordPolicyRel.resetOriginalValues();
1149
1150 return passwordPolicyRel;
1151 }
1152
1153 protected PasswordPolicyRel toUnwrappedModel(
1154 PasswordPolicyRel passwordPolicyRel) {
1155 if (passwordPolicyRel instanceof PasswordPolicyRelImpl) {
1156 return passwordPolicyRel;
1157 }
1158
1159 PasswordPolicyRelImpl passwordPolicyRelImpl = new PasswordPolicyRelImpl();
1160
1161 passwordPolicyRelImpl.setNew(passwordPolicyRel.isNew());
1162 passwordPolicyRelImpl.setPrimaryKey(passwordPolicyRel.getPrimaryKey());
1163
1164 passwordPolicyRelImpl.setMvccVersion(passwordPolicyRel.getMvccVersion());
1165 passwordPolicyRelImpl.setPasswordPolicyRelId(passwordPolicyRel.getPasswordPolicyRelId());
1166 passwordPolicyRelImpl.setCompanyId(passwordPolicyRel.getCompanyId());
1167 passwordPolicyRelImpl.setPasswordPolicyId(passwordPolicyRel.getPasswordPolicyId());
1168 passwordPolicyRelImpl.setClassNameId(passwordPolicyRel.getClassNameId());
1169 passwordPolicyRelImpl.setClassPK(passwordPolicyRel.getClassPK());
1170
1171 return passwordPolicyRelImpl;
1172 }
1173
1174
1181 @Override
1182 public PasswordPolicyRel findByPrimaryKey(Serializable primaryKey)
1183 throws NoSuchPasswordPolicyRelException {
1184 PasswordPolicyRel passwordPolicyRel = fetchByPrimaryKey(primaryKey);
1185
1186 if (passwordPolicyRel == null) {
1187 if (_log.isWarnEnabled()) {
1188 _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey);
1189 }
1190
1191 throw new NoSuchPasswordPolicyRelException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
1192 primaryKey);
1193 }
1194
1195 return passwordPolicyRel;
1196 }
1197
1198
1205 @Override
1206 public PasswordPolicyRel findByPrimaryKey(long passwordPolicyRelId)
1207 throws NoSuchPasswordPolicyRelException {
1208 return findByPrimaryKey((Serializable)passwordPolicyRelId);
1209 }
1210
1211
1217 @Override
1218 public PasswordPolicyRel fetchByPrimaryKey(Serializable primaryKey) {
1219 PasswordPolicyRel passwordPolicyRel = (PasswordPolicyRel)entityCache.getResult(PasswordPolicyRelModelImpl.ENTITY_CACHE_ENABLED,
1220 PasswordPolicyRelImpl.class, primaryKey);
1221
1222 if (passwordPolicyRel == _nullPasswordPolicyRel) {
1223 return null;
1224 }
1225
1226 if (passwordPolicyRel == null) {
1227 Session session = null;
1228
1229 try {
1230 session = openSession();
1231
1232 passwordPolicyRel = (PasswordPolicyRel)session.get(PasswordPolicyRelImpl.class,
1233 primaryKey);
1234
1235 if (passwordPolicyRel != null) {
1236 cacheResult(passwordPolicyRel);
1237 }
1238 else {
1239 entityCache.putResult(PasswordPolicyRelModelImpl.ENTITY_CACHE_ENABLED,
1240 PasswordPolicyRelImpl.class, primaryKey,
1241 _nullPasswordPolicyRel);
1242 }
1243 }
1244 catch (Exception e) {
1245 entityCache.removeResult(PasswordPolicyRelModelImpl.ENTITY_CACHE_ENABLED,
1246 PasswordPolicyRelImpl.class, primaryKey);
1247
1248 throw processException(e);
1249 }
1250 finally {
1251 closeSession(session);
1252 }
1253 }
1254
1255 return passwordPolicyRel;
1256 }
1257
1258
1264 @Override
1265 public PasswordPolicyRel fetchByPrimaryKey(long passwordPolicyRelId) {
1266 return fetchByPrimaryKey((Serializable)passwordPolicyRelId);
1267 }
1268
1269 @Override
1270 public Map<Serializable, PasswordPolicyRel> fetchByPrimaryKeys(
1271 Set<Serializable> primaryKeys) {
1272 if (primaryKeys.isEmpty()) {
1273 return Collections.emptyMap();
1274 }
1275
1276 Map<Serializable, PasswordPolicyRel> map = new HashMap<Serializable, PasswordPolicyRel>();
1277
1278 if (primaryKeys.size() == 1) {
1279 Iterator<Serializable> iterator = primaryKeys.iterator();
1280
1281 Serializable primaryKey = iterator.next();
1282
1283 PasswordPolicyRel passwordPolicyRel = fetchByPrimaryKey(primaryKey);
1284
1285 if (passwordPolicyRel != null) {
1286 map.put(primaryKey, passwordPolicyRel);
1287 }
1288
1289 return map;
1290 }
1291
1292 Set<Serializable> uncachedPrimaryKeys = null;
1293
1294 for (Serializable primaryKey : primaryKeys) {
1295 PasswordPolicyRel passwordPolicyRel = (PasswordPolicyRel)entityCache.getResult(PasswordPolicyRelModelImpl.ENTITY_CACHE_ENABLED,
1296 PasswordPolicyRelImpl.class, primaryKey);
1297
1298 if (passwordPolicyRel == null) {
1299 if (uncachedPrimaryKeys == null) {
1300 uncachedPrimaryKeys = new HashSet<Serializable>();
1301 }
1302
1303 uncachedPrimaryKeys.add(primaryKey);
1304 }
1305 else {
1306 map.put(primaryKey, passwordPolicyRel);
1307 }
1308 }
1309
1310 if (uncachedPrimaryKeys == null) {
1311 return map;
1312 }
1313
1314 StringBundler query = new StringBundler((uncachedPrimaryKeys.size() * 2) +
1315 1);
1316
1317 query.append(_SQL_SELECT_PASSWORDPOLICYREL_WHERE_PKS_IN);
1318
1319 for (Serializable primaryKey : uncachedPrimaryKeys) {
1320 query.append(String.valueOf(primaryKey));
1321
1322 query.append(StringPool.COMMA);
1323 }
1324
1325 query.setIndex(query.index() - 1);
1326
1327 query.append(StringPool.CLOSE_PARENTHESIS);
1328
1329 String sql = query.toString();
1330
1331 Session session = null;
1332
1333 try {
1334 session = openSession();
1335
1336 Query q = session.createQuery(sql);
1337
1338 for (PasswordPolicyRel passwordPolicyRel : (List<PasswordPolicyRel>)q.list()) {
1339 map.put(passwordPolicyRel.getPrimaryKeyObj(), passwordPolicyRel);
1340
1341 cacheResult(passwordPolicyRel);
1342
1343 uncachedPrimaryKeys.remove(passwordPolicyRel.getPrimaryKeyObj());
1344 }
1345
1346 for (Serializable primaryKey : uncachedPrimaryKeys) {
1347 entityCache.putResult(PasswordPolicyRelModelImpl.ENTITY_CACHE_ENABLED,
1348 PasswordPolicyRelImpl.class, primaryKey,
1349 _nullPasswordPolicyRel);
1350 }
1351 }
1352 catch (Exception e) {
1353 throw processException(e);
1354 }
1355 finally {
1356 closeSession(session);
1357 }
1358
1359 return map;
1360 }
1361
1362
1367 @Override
1368 public List<PasswordPolicyRel> findAll() {
1369 return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
1370 }
1371
1372
1383 @Override
1384 public List<PasswordPolicyRel> findAll(int start, int end) {
1385 return findAll(start, end, null);
1386 }
1387
1388
1400 @Override
1401 public List<PasswordPolicyRel> findAll(int start, int end,
1402 OrderByComparator<PasswordPolicyRel> orderByComparator) {
1403 return findAll(start, end, orderByComparator, true);
1404 }
1405
1406
1419 @Override
1420 public List<PasswordPolicyRel> findAll(int start, int end,
1421 OrderByComparator<PasswordPolicyRel> orderByComparator,
1422 boolean retrieveFromCache) {
1423 boolean pagination = true;
1424 FinderPath finderPath = null;
1425 Object[] finderArgs = null;
1426
1427 if ((start == QueryUtil.ALL_POS) && (end == QueryUtil.ALL_POS) &&
1428 (orderByComparator == null)) {
1429 pagination = false;
1430 finderPath = FINDER_PATH_WITHOUT_PAGINATION_FIND_ALL;
1431 finderArgs = FINDER_ARGS_EMPTY;
1432 }
1433 else {
1434 finderPath = FINDER_PATH_WITH_PAGINATION_FIND_ALL;
1435 finderArgs = new Object[] { start, end, orderByComparator };
1436 }
1437
1438 List<PasswordPolicyRel> list = null;
1439
1440 if (retrieveFromCache) {
1441 list = (List<PasswordPolicyRel>)finderCache.getResult(finderPath,
1442 finderArgs, this);
1443 }
1444
1445 if (list == null) {
1446 StringBundler query = null;
1447 String sql = null;
1448
1449 if (orderByComparator != null) {
1450 query = new StringBundler(2 +
1451 (orderByComparator.getOrderByFields().length * 2));
1452
1453 query.append(_SQL_SELECT_PASSWORDPOLICYREL);
1454
1455 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
1456 orderByComparator);
1457
1458 sql = query.toString();
1459 }
1460 else {
1461 sql = _SQL_SELECT_PASSWORDPOLICYREL;
1462
1463 if (pagination) {
1464 sql = sql.concat(PasswordPolicyRelModelImpl.ORDER_BY_JPQL);
1465 }
1466 }
1467
1468 Session session = null;
1469
1470 try {
1471 session = openSession();
1472
1473 Query q = session.createQuery(sql);
1474
1475 if (!pagination) {
1476 list = (List<PasswordPolicyRel>)QueryUtil.list(q,
1477 getDialect(), start, end, false);
1478
1479 Collections.sort(list);
1480
1481 list = Collections.unmodifiableList(list);
1482 }
1483 else {
1484 list = (List<PasswordPolicyRel>)QueryUtil.list(q,
1485 getDialect(), start, end);
1486 }
1487
1488 cacheResult(list);
1489
1490 finderCache.putResult(finderPath, finderArgs, list);
1491 }
1492 catch (Exception e) {
1493 finderCache.removeResult(finderPath, finderArgs);
1494
1495 throw processException(e);
1496 }
1497 finally {
1498 closeSession(session);
1499 }
1500 }
1501
1502 return list;
1503 }
1504
1505
1509 @Override
1510 public void removeAll() {
1511 for (PasswordPolicyRel passwordPolicyRel : findAll()) {
1512 remove(passwordPolicyRel);
1513 }
1514 }
1515
1516
1521 @Override
1522 public int countAll() {
1523 Long count = (Long)finderCache.getResult(FINDER_PATH_COUNT_ALL,
1524 FINDER_ARGS_EMPTY, this);
1525
1526 if (count == null) {
1527 Session session = null;
1528
1529 try {
1530 session = openSession();
1531
1532 Query q = session.createQuery(_SQL_COUNT_PASSWORDPOLICYREL);
1533
1534 count = (Long)q.uniqueResult();
1535
1536 finderCache.putResult(FINDER_PATH_COUNT_ALL, FINDER_ARGS_EMPTY,
1537 count);
1538 }
1539 catch (Exception e) {
1540 finderCache.removeResult(FINDER_PATH_COUNT_ALL,
1541 FINDER_ARGS_EMPTY);
1542
1543 throw processException(e);
1544 }
1545 finally {
1546 closeSession(session);
1547 }
1548 }
1549
1550 return count.intValue();
1551 }
1552
1553 @Override
1554 protected Map<String, Integer> getTableColumnsMap() {
1555 return PasswordPolicyRelModelImpl.TABLE_COLUMNS_MAP;
1556 }
1557
1558
1561 public void afterPropertiesSet() {
1562 }
1563
1564 public void destroy() {
1565 entityCache.removeCache(PasswordPolicyRelImpl.class.getName());
1566 finderCache.removeCache(FINDER_CLASS_NAME_ENTITY);
1567 finderCache.removeCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
1568 finderCache.removeCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
1569 }
1570
1571 @BeanReference(type = CompanyProviderWrapper.class)
1572 protected CompanyProvider companyProvider;
1573 protected EntityCache entityCache = EntityCacheUtil.getEntityCache();
1574 protected FinderCache finderCache = FinderCacheUtil.getFinderCache();
1575 private static final String _SQL_SELECT_PASSWORDPOLICYREL = "SELECT passwordPolicyRel FROM PasswordPolicyRel passwordPolicyRel";
1576 private static final String _SQL_SELECT_PASSWORDPOLICYREL_WHERE_PKS_IN = "SELECT passwordPolicyRel FROM PasswordPolicyRel passwordPolicyRel WHERE passwordPolicyRelId IN (";
1577 private static final String _SQL_SELECT_PASSWORDPOLICYREL_WHERE = "SELECT passwordPolicyRel FROM PasswordPolicyRel passwordPolicyRel WHERE ";
1578 private static final String _SQL_COUNT_PASSWORDPOLICYREL = "SELECT COUNT(passwordPolicyRel) FROM PasswordPolicyRel passwordPolicyRel";
1579 private static final String _SQL_COUNT_PASSWORDPOLICYREL_WHERE = "SELECT COUNT(passwordPolicyRel) FROM PasswordPolicyRel passwordPolicyRel WHERE ";
1580 private static final String _ORDER_BY_ENTITY_ALIAS = "passwordPolicyRel.";
1581 private static final String _NO_SUCH_ENTITY_WITH_PRIMARY_KEY = "No PasswordPolicyRel exists with the primary key ";
1582 private static final String _NO_SUCH_ENTITY_WITH_KEY = "No PasswordPolicyRel exists with the key {";
1583 private static final Log _log = LogFactoryUtil.getLog(PasswordPolicyRelPersistenceImpl.class);
1584 private static final PasswordPolicyRel _nullPasswordPolicyRel = new PasswordPolicyRelImpl() {
1585 @Override
1586 public Object clone() {
1587 return this;
1588 }
1589
1590 @Override
1591 public CacheModel<PasswordPolicyRel> toCacheModel() {
1592 return _nullPasswordPolicyRelCacheModel;
1593 }
1594 };
1595
1596 private static final CacheModel<PasswordPolicyRel> _nullPasswordPolicyRelCacheModel =
1597 new NullCacheModel();
1598
1599 private static class NullCacheModel implements CacheModel<PasswordPolicyRel>,
1600 MVCCModel {
1601 @Override
1602 public long getMvccVersion() {
1603 return -1;
1604 }
1605
1606 @Override
1607 public void setMvccVersion(long mvccVersion) {
1608 }
1609
1610 @Override
1611 public PasswordPolicyRel toEntityModel() {
1612 return _nullPasswordPolicyRel;
1613 }
1614 }
1615 }