001
014
015 package com.liferay.portal.service.persistence;
016
017 import com.liferay.portal.NoSuchClassNameException;
018 import com.liferay.portal.NoSuchModelException;
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.ClassName;
039 import com.liferay.portal.model.ModelListener;
040 import com.liferay.portal.model.impl.ClassNameImpl;
041 import com.liferay.portal.model.impl.ClassNameModelImpl;
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 ClassNamePersistenceImpl extends BasePersistenceImpl<ClassName>
063 implements ClassNamePersistence {
064
069 public static final String FINDER_CLASS_NAME_ENTITY = ClassNameImpl.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_FETCH_BY_VALUE = new FinderPath(ClassNameModelImpl.ENTITY_CACHE_ENABLED,
075 ClassNameModelImpl.FINDER_CACHE_ENABLED, ClassNameImpl.class,
076 FINDER_CLASS_NAME_ENTITY, "fetchByValue",
077 new String[] { String.class.getName() },
078 ClassNameModelImpl.VALUE_COLUMN_BITMASK);
079 public static final FinderPath FINDER_PATH_COUNT_BY_VALUE = new FinderPath(ClassNameModelImpl.ENTITY_CACHE_ENABLED,
080 ClassNameModelImpl.FINDER_CACHE_ENABLED, Long.class,
081 FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "countByValue",
082 new String[] { String.class.getName() });
083 public static final FinderPath FINDER_PATH_WITH_PAGINATION_FIND_ALL = new FinderPath(ClassNameModelImpl.ENTITY_CACHE_ENABLED,
084 ClassNameModelImpl.FINDER_CACHE_ENABLED, ClassNameImpl.class,
085 FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "findAll", new String[0]);
086 public static final FinderPath FINDER_PATH_WITHOUT_PAGINATION_FIND_ALL = new FinderPath(ClassNameModelImpl.ENTITY_CACHE_ENABLED,
087 ClassNameModelImpl.FINDER_CACHE_ENABLED, ClassNameImpl.class,
088 FINDER_CLASS_NAME_LIST_WITH_PAGINATION, "findAll", new String[0]);
089 public static final FinderPath FINDER_PATH_COUNT_ALL = new FinderPath(ClassNameModelImpl.ENTITY_CACHE_ENABLED,
090 ClassNameModelImpl.FINDER_CACHE_ENABLED, Long.class,
091 FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "countAll", new String[0]);
092
093
098 public void cacheResult(ClassName className) {
099 EntityCacheUtil.putResult(ClassNameModelImpl.ENTITY_CACHE_ENABLED,
100 ClassNameImpl.class, className.getPrimaryKey(), className);
101
102 FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_VALUE,
103 new Object[] { className.getValue() }, className);
104
105 className.resetOriginalValues();
106 }
107
108
113 public void cacheResult(List<ClassName> classNames) {
114 for (ClassName className : classNames) {
115 if (EntityCacheUtil.getResult(
116 ClassNameModelImpl.ENTITY_CACHE_ENABLED,
117 ClassNameImpl.class, className.getPrimaryKey()) == null) {
118 cacheResult(className);
119 }
120 else {
121 className.resetOriginalValues();
122 }
123 }
124 }
125
126
133 @Override
134 public void clearCache() {
135 if (_HIBERNATE_CACHE_USE_SECOND_LEVEL_CACHE) {
136 CacheRegistryUtil.clear(ClassNameImpl.class.getName());
137 }
138
139 EntityCacheUtil.clearCache(ClassNameImpl.class.getName());
140
141 FinderCacheUtil.clearCache(FINDER_CLASS_NAME_ENTITY);
142 FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
143 FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
144 }
145
146
153 @Override
154 public void clearCache(ClassName className) {
155 EntityCacheUtil.removeResult(ClassNameModelImpl.ENTITY_CACHE_ENABLED,
156 ClassNameImpl.class, className.getPrimaryKey());
157
158 FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
159 FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
160
161 clearUniqueFindersCache(className);
162 }
163
164 @Override
165 public void clearCache(List<ClassName> classNames) {
166 FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
167 FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
168
169 for (ClassName className : classNames) {
170 EntityCacheUtil.removeResult(ClassNameModelImpl.ENTITY_CACHE_ENABLED,
171 ClassNameImpl.class, className.getPrimaryKey());
172
173 clearUniqueFindersCache(className);
174 }
175 }
176
177 protected void clearUniqueFindersCache(ClassName className) {
178 FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_VALUE,
179 new Object[] { className.getValue() });
180 }
181
182
188 public ClassName create(long classNameId) {
189 ClassName className = new ClassNameImpl();
190
191 className.setNew(true);
192 className.setPrimaryKey(classNameId);
193
194 return className;
195 }
196
197
205 public ClassName remove(long classNameId)
206 throws NoSuchClassNameException, SystemException {
207 return remove(Long.valueOf(classNameId));
208 }
209
210
218 @Override
219 public ClassName remove(Serializable primaryKey)
220 throws NoSuchClassNameException, SystemException {
221 Session session = null;
222
223 try {
224 session = openSession();
225
226 ClassName className = (ClassName)session.get(ClassNameImpl.class,
227 primaryKey);
228
229 if (className == null) {
230 if (_log.isWarnEnabled()) {
231 _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey);
232 }
233
234 throw new NoSuchClassNameException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
235 primaryKey);
236 }
237
238 return remove(className);
239 }
240 catch (NoSuchClassNameException nsee) {
241 throw nsee;
242 }
243 catch (Exception e) {
244 throw processException(e);
245 }
246 finally {
247 closeSession(session);
248 }
249 }
250
251 @Override
252 protected ClassName removeImpl(ClassName className)
253 throws SystemException {
254 className = toUnwrappedModel(className);
255
256 Session session = null;
257
258 try {
259 session = openSession();
260
261 BatchSessionUtil.delete(session, className);
262 }
263 catch (Exception e) {
264 throw processException(e);
265 }
266 finally {
267 closeSession(session);
268 }
269
270 clearCache(className);
271
272 return className;
273 }
274
275 @Override
276 public ClassName updateImpl(com.liferay.portal.model.ClassName className,
277 boolean merge) throws SystemException {
278 className = toUnwrappedModel(className);
279
280 boolean isNew = className.isNew();
281
282 ClassNameModelImpl classNameModelImpl = (ClassNameModelImpl)className;
283
284 Session session = null;
285
286 try {
287 session = openSession();
288
289 BatchSessionUtil.update(session, className, merge);
290
291 className.setNew(false);
292 }
293 catch (Exception e) {
294 throw processException(e);
295 }
296 finally {
297 closeSession(session);
298 }
299
300 FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
301
302 if (isNew || !ClassNameModelImpl.COLUMN_BITMASK_ENABLED) {
303 FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
304 }
305
306 EntityCacheUtil.putResult(ClassNameModelImpl.ENTITY_CACHE_ENABLED,
307 ClassNameImpl.class, className.getPrimaryKey(), className);
308
309 if (isNew) {
310 FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_VALUE,
311 new Object[] { className.getValue() }, className);
312 }
313 else {
314 if ((classNameModelImpl.getColumnBitmask() &
315 FINDER_PATH_FETCH_BY_VALUE.getColumnBitmask()) != 0) {
316 Object[] args = new Object[] {
317 classNameModelImpl.getOriginalValue()
318 };
319
320 FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_VALUE, args);
321 FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_VALUE, args);
322
323 FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_VALUE,
324 new Object[] { className.getValue() }, className);
325 }
326 }
327
328 return className;
329 }
330
331 protected ClassName toUnwrappedModel(ClassName className) {
332 if (className instanceof ClassNameImpl) {
333 return className;
334 }
335
336 ClassNameImpl classNameImpl = new ClassNameImpl();
337
338 classNameImpl.setNew(className.isNew());
339 classNameImpl.setPrimaryKey(className.getPrimaryKey());
340
341 classNameImpl.setClassNameId(className.getClassNameId());
342 classNameImpl.setValue(className.getValue());
343
344 return classNameImpl;
345 }
346
347
355 @Override
356 public ClassName findByPrimaryKey(Serializable primaryKey)
357 throws NoSuchModelException, SystemException {
358 return findByPrimaryKey(((Long)primaryKey).longValue());
359 }
360
361
369 public ClassName findByPrimaryKey(long classNameId)
370 throws NoSuchClassNameException, SystemException {
371 ClassName className = fetchByPrimaryKey(classNameId);
372
373 if (className == null) {
374 if (_log.isWarnEnabled()) {
375 _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + classNameId);
376 }
377
378 throw new NoSuchClassNameException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
379 classNameId);
380 }
381
382 return className;
383 }
384
385
392 @Override
393 public ClassName fetchByPrimaryKey(Serializable primaryKey)
394 throws SystemException {
395 return fetchByPrimaryKey(((Long)primaryKey).longValue());
396 }
397
398
405 public ClassName fetchByPrimaryKey(long classNameId)
406 throws SystemException {
407 ClassName className = (ClassName)EntityCacheUtil.getResult(ClassNameModelImpl.ENTITY_CACHE_ENABLED,
408 ClassNameImpl.class, classNameId);
409
410 if (className == _nullClassName) {
411 return null;
412 }
413
414 if (className == null) {
415 Session session = null;
416
417 boolean hasException = false;
418
419 try {
420 session = openSession();
421
422 className = (ClassName)session.get(ClassNameImpl.class,
423 Long.valueOf(classNameId));
424 }
425 catch (Exception e) {
426 hasException = true;
427
428 throw processException(e);
429 }
430 finally {
431 if (className != null) {
432 cacheResult(className);
433 }
434 else if (!hasException) {
435 EntityCacheUtil.putResult(ClassNameModelImpl.ENTITY_CACHE_ENABLED,
436 ClassNameImpl.class, classNameId, _nullClassName);
437 }
438
439 closeSession(session);
440 }
441 }
442
443 return className;
444 }
445
446
454 public ClassName findByValue(String value)
455 throws NoSuchClassNameException, SystemException {
456 ClassName className = fetchByValue(value);
457
458 if (className == null) {
459 StringBundler msg = new StringBundler(4);
460
461 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
462
463 msg.append("value=");
464 msg.append(value);
465
466 msg.append(StringPool.CLOSE_CURLY_BRACE);
467
468 if (_log.isWarnEnabled()) {
469 _log.warn(msg.toString());
470 }
471
472 throw new NoSuchClassNameException(msg.toString());
473 }
474
475 return className;
476 }
477
478
485 public ClassName fetchByValue(String value) throws SystemException {
486 return fetchByValue(value, true);
487 }
488
489
497 public ClassName fetchByValue(String value, boolean retrieveFromCache)
498 throws SystemException {
499 Object[] finderArgs = new Object[] { value };
500
501 Object result = null;
502
503 if (retrieveFromCache) {
504 result = FinderCacheUtil.getResult(FINDER_PATH_FETCH_BY_VALUE,
505 finderArgs, this);
506 }
507
508 if (result == null) {
509 StringBundler query = new StringBundler(2);
510
511 query.append(_SQL_SELECT_CLASSNAME_WHERE);
512
513 if (value == null) {
514 query.append(_FINDER_COLUMN_VALUE_VALUE_1);
515 }
516 else {
517 if (value.equals(StringPool.BLANK)) {
518 query.append(_FINDER_COLUMN_VALUE_VALUE_3);
519 }
520 else {
521 query.append(_FINDER_COLUMN_VALUE_VALUE_2);
522 }
523 }
524
525 String sql = query.toString();
526
527 Session session = null;
528
529 try {
530 session = openSession();
531
532 Query q = session.createQuery(sql);
533
534 QueryPos qPos = QueryPos.getInstance(q);
535
536 if (value != null) {
537 qPos.add(value);
538 }
539
540 List<ClassName> list = q.list();
541
542 result = list;
543
544 ClassName className = null;
545
546 if (list.isEmpty()) {
547 FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_VALUE,
548 finderArgs, list);
549 }
550 else {
551 className = list.get(0);
552
553 cacheResult(className);
554
555 if ((className.getValue() == null) ||
556 !className.getValue().equals(value)) {
557 FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_VALUE,
558 finderArgs, className);
559 }
560 }
561
562 return className;
563 }
564 catch (Exception e) {
565 throw processException(e);
566 }
567 finally {
568 if (result == null) {
569 FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_VALUE,
570 finderArgs);
571 }
572
573 closeSession(session);
574 }
575 }
576 else {
577 if (result instanceof List<?>) {
578 return null;
579 }
580 else {
581 return (ClassName)result;
582 }
583 }
584 }
585
586
592 public List<ClassName> findAll() throws SystemException {
593 return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
594 }
595
596
608 public List<ClassName> findAll(int start, int end)
609 throws SystemException {
610 return findAll(start, end, null);
611 }
612
613
626 public List<ClassName> findAll(int start, int end,
627 OrderByComparator orderByComparator) throws SystemException {
628 FinderPath finderPath = null;
629 Object[] finderArgs = new Object[] { start, end, orderByComparator };
630
631 if ((start == QueryUtil.ALL_POS) && (end == QueryUtil.ALL_POS) &&
632 (orderByComparator == null)) {
633 finderPath = FINDER_PATH_WITH_PAGINATION_FIND_ALL;
634 finderArgs = FINDER_ARGS_EMPTY;
635 }
636 else {
637 finderPath = FINDER_PATH_WITHOUT_PAGINATION_FIND_ALL;
638 finderArgs = new Object[] { start, end, orderByComparator };
639 }
640
641 List<ClassName> list = (List<ClassName>)FinderCacheUtil.getResult(finderPath,
642 finderArgs, this);
643
644 if (list == null) {
645 StringBundler query = null;
646 String sql = null;
647
648 if (orderByComparator != null) {
649 query = new StringBundler(2 +
650 (orderByComparator.getOrderByFields().length * 3));
651
652 query.append(_SQL_SELECT_CLASSNAME);
653
654 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
655 orderByComparator);
656
657 sql = query.toString();
658 }
659 else {
660 sql = _SQL_SELECT_CLASSNAME;
661 }
662
663 Session session = null;
664
665 try {
666 session = openSession();
667
668 Query q = session.createQuery(sql);
669
670 if (orderByComparator == null) {
671 list = (List<ClassName>)QueryUtil.list(q, getDialect(),
672 start, end, false);
673
674 Collections.sort(list);
675 }
676 else {
677 list = (List<ClassName>)QueryUtil.list(q, getDialect(),
678 start, end);
679 }
680 }
681 catch (Exception e) {
682 throw processException(e);
683 }
684 finally {
685 if (list == null) {
686 FinderCacheUtil.removeResult(finderPath, finderArgs);
687 }
688 else {
689 cacheResult(list);
690
691 FinderCacheUtil.putResult(finderPath, finderArgs, list);
692 }
693
694 closeSession(session);
695 }
696 }
697
698 return list;
699 }
700
701
707 public void removeByValue(String value)
708 throws NoSuchClassNameException, SystemException {
709 ClassName className = findByValue(value);
710
711 remove(className);
712 }
713
714
719 public void removeAll() throws SystemException {
720 for (ClassName className : findAll()) {
721 remove(className);
722 }
723 }
724
725
732 public int countByValue(String value) throws SystemException {
733 Object[] finderArgs = new Object[] { value };
734
735 Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_VALUE,
736 finderArgs, this);
737
738 if (count == null) {
739 StringBundler query = new StringBundler(2);
740
741 query.append(_SQL_COUNT_CLASSNAME_WHERE);
742
743 if (value == null) {
744 query.append(_FINDER_COLUMN_VALUE_VALUE_1);
745 }
746 else {
747 if (value.equals(StringPool.BLANK)) {
748 query.append(_FINDER_COLUMN_VALUE_VALUE_3);
749 }
750 else {
751 query.append(_FINDER_COLUMN_VALUE_VALUE_2);
752 }
753 }
754
755 String sql = query.toString();
756
757 Session session = null;
758
759 try {
760 session = openSession();
761
762 Query q = session.createQuery(sql);
763
764 QueryPos qPos = QueryPos.getInstance(q);
765
766 if (value != null) {
767 qPos.add(value);
768 }
769
770 count = (Long)q.uniqueResult();
771 }
772 catch (Exception e) {
773 throw processException(e);
774 }
775 finally {
776 if (count == null) {
777 count = Long.valueOf(0);
778 }
779
780 FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_VALUE,
781 finderArgs, count);
782
783 closeSession(session);
784 }
785 }
786
787 return count.intValue();
788 }
789
790
796 public int countAll() throws SystemException {
797 Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_ALL,
798 FINDER_ARGS_EMPTY, this);
799
800 if (count == null) {
801 Session session = null;
802
803 try {
804 session = openSession();
805
806 Query q = session.createQuery(_SQL_COUNT_CLASSNAME);
807
808 count = (Long)q.uniqueResult();
809 }
810 catch (Exception e) {
811 throw processException(e);
812 }
813 finally {
814 if (count == null) {
815 count = Long.valueOf(0);
816 }
817
818 FinderCacheUtil.putResult(FINDER_PATH_COUNT_ALL,
819 FINDER_ARGS_EMPTY, count);
820
821 closeSession(session);
822 }
823 }
824
825 return count.intValue();
826 }
827
828
831 public void afterPropertiesSet() {
832 String[] listenerClassNames = StringUtil.split(GetterUtil.getString(
833 com.liferay.portal.util.PropsUtil.get(
834 "value.object.listener.com.liferay.portal.model.ClassName")));
835
836 if (listenerClassNames.length > 0) {
837 try {
838 List<ModelListener<ClassName>> listenersList = new ArrayList<ModelListener<ClassName>>();
839
840 for (String listenerClassName : listenerClassNames) {
841 listenersList.add((ModelListener<ClassName>)InstanceFactory.newInstance(
842 listenerClassName));
843 }
844
845 listeners = listenersList.toArray(new ModelListener[listenersList.size()]);
846 }
847 catch (Exception e) {
848 _log.error(e);
849 }
850 }
851 }
852
853 public void destroy() {
854 EntityCacheUtil.removeCache(ClassNameImpl.class.getName());
855 FinderCacheUtil.removeCache(FINDER_CLASS_NAME_ENTITY);
856 FinderCacheUtil.removeCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
857 }
858
859 @BeanReference(type = AccountPersistence.class)
860 protected AccountPersistence accountPersistence;
861 @BeanReference(type = AddressPersistence.class)
862 protected AddressPersistence addressPersistence;
863 @BeanReference(type = BrowserTrackerPersistence.class)
864 protected BrowserTrackerPersistence browserTrackerPersistence;
865 @BeanReference(type = ClassNamePersistence.class)
866 protected ClassNamePersistence classNamePersistence;
867 @BeanReference(type = ClusterGroupPersistence.class)
868 protected ClusterGroupPersistence clusterGroupPersistence;
869 @BeanReference(type = CompanyPersistence.class)
870 protected CompanyPersistence companyPersistence;
871 @BeanReference(type = ContactPersistence.class)
872 protected ContactPersistence contactPersistence;
873 @BeanReference(type = CountryPersistence.class)
874 protected CountryPersistence countryPersistence;
875 @BeanReference(type = EmailAddressPersistence.class)
876 protected EmailAddressPersistence emailAddressPersistence;
877 @BeanReference(type = GroupPersistence.class)
878 protected GroupPersistence groupPersistence;
879 @BeanReference(type = ImagePersistence.class)
880 protected ImagePersistence imagePersistence;
881 @BeanReference(type = LayoutPersistence.class)
882 protected LayoutPersistence layoutPersistence;
883 @BeanReference(type = LayoutBranchPersistence.class)
884 protected LayoutBranchPersistence layoutBranchPersistence;
885 @BeanReference(type = LayoutPrototypePersistence.class)
886 protected LayoutPrototypePersistence layoutPrototypePersistence;
887 @BeanReference(type = LayoutRevisionPersistence.class)
888 protected LayoutRevisionPersistence layoutRevisionPersistence;
889 @BeanReference(type = LayoutSetPersistence.class)
890 protected LayoutSetPersistence layoutSetPersistence;
891 @BeanReference(type = LayoutSetBranchPersistence.class)
892 protected LayoutSetBranchPersistence layoutSetBranchPersistence;
893 @BeanReference(type = LayoutSetPrototypePersistence.class)
894 protected LayoutSetPrototypePersistence layoutSetPrototypePersistence;
895 @BeanReference(type = ListTypePersistence.class)
896 protected ListTypePersistence listTypePersistence;
897 @BeanReference(type = LockPersistence.class)
898 protected LockPersistence lockPersistence;
899 @BeanReference(type = MembershipRequestPersistence.class)
900 protected MembershipRequestPersistence membershipRequestPersistence;
901 @BeanReference(type = OrganizationPersistence.class)
902 protected OrganizationPersistence organizationPersistence;
903 @BeanReference(type = OrgGroupPermissionPersistence.class)
904 protected OrgGroupPermissionPersistence orgGroupPermissionPersistence;
905 @BeanReference(type = OrgGroupRolePersistence.class)
906 protected OrgGroupRolePersistence orgGroupRolePersistence;
907 @BeanReference(type = OrgLaborPersistence.class)
908 protected OrgLaborPersistence orgLaborPersistence;
909 @BeanReference(type = PasswordPolicyPersistence.class)
910 protected PasswordPolicyPersistence passwordPolicyPersistence;
911 @BeanReference(type = PasswordPolicyRelPersistence.class)
912 protected PasswordPolicyRelPersistence passwordPolicyRelPersistence;
913 @BeanReference(type = PasswordTrackerPersistence.class)
914 protected PasswordTrackerPersistence passwordTrackerPersistence;
915 @BeanReference(type = PermissionPersistence.class)
916 protected PermissionPersistence permissionPersistence;
917 @BeanReference(type = PhonePersistence.class)
918 protected PhonePersistence phonePersistence;
919 @BeanReference(type = PluginSettingPersistence.class)
920 protected PluginSettingPersistence pluginSettingPersistence;
921 @BeanReference(type = PortalPreferencesPersistence.class)
922 protected PortalPreferencesPersistence portalPreferencesPersistence;
923 @BeanReference(type = PortletPersistence.class)
924 protected PortletPersistence portletPersistence;
925 @BeanReference(type = PortletItemPersistence.class)
926 protected PortletItemPersistence portletItemPersistence;
927 @BeanReference(type = PortletPreferencesPersistence.class)
928 protected PortletPreferencesPersistence portletPreferencesPersistence;
929 @BeanReference(type = RegionPersistence.class)
930 protected RegionPersistence regionPersistence;
931 @BeanReference(type = ReleasePersistence.class)
932 protected ReleasePersistence releasePersistence;
933 @BeanReference(type = RepositoryPersistence.class)
934 protected RepositoryPersistence repositoryPersistence;
935 @BeanReference(type = RepositoryEntryPersistence.class)
936 protected RepositoryEntryPersistence repositoryEntryPersistence;
937 @BeanReference(type = ResourcePersistence.class)
938 protected ResourcePersistence resourcePersistence;
939 @BeanReference(type = ResourceActionPersistence.class)
940 protected ResourceActionPersistence resourceActionPersistence;
941 @BeanReference(type = ResourceBlockPersistence.class)
942 protected ResourceBlockPersistence resourceBlockPersistence;
943 @BeanReference(type = ResourceBlockPermissionPersistence.class)
944 protected ResourceBlockPermissionPersistence resourceBlockPermissionPersistence;
945 @BeanReference(type = ResourceCodePersistence.class)
946 protected ResourceCodePersistence resourceCodePersistence;
947 @BeanReference(type = ResourcePermissionPersistence.class)
948 protected ResourcePermissionPersistence resourcePermissionPersistence;
949 @BeanReference(type = ResourceTypePermissionPersistence.class)
950 protected ResourceTypePermissionPersistence resourceTypePermissionPersistence;
951 @BeanReference(type = RolePersistence.class)
952 protected RolePersistence rolePersistence;
953 @BeanReference(type = ServiceComponentPersistence.class)
954 protected ServiceComponentPersistence serviceComponentPersistence;
955 @BeanReference(type = ShardPersistence.class)
956 protected ShardPersistence shardPersistence;
957 @BeanReference(type = SubscriptionPersistence.class)
958 protected SubscriptionPersistence subscriptionPersistence;
959 @BeanReference(type = TeamPersistence.class)
960 protected TeamPersistence teamPersistence;
961 @BeanReference(type = TicketPersistence.class)
962 protected TicketPersistence ticketPersistence;
963 @BeanReference(type = UserPersistence.class)
964 protected UserPersistence userPersistence;
965 @BeanReference(type = UserGroupPersistence.class)
966 protected UserGroupPersistence userGroupPersistence;
967 @BeanReference(type = UserGroupGroupRolePersistence.class)
968 protected UserGroupGroupRolePersistence userGroupGroupRolePersistence;
969 @BeanReference(type = UserGroupRolePersistence.class)
970 protected UserGroupRolePersistence userGroupRolePersistence;
971 @BeanReference(type = UserIdMapperPersistence.class)
972 protected UserIdMapperPersistence userIdMapperPersistence;
973 @BeanReference(type = UserNotificationEventPersistence.class)
974 protected UserNotificationEventPersistence userNotificationEventPersistence;
975 @BeanReference(type = UserTrackerPersistence.class)
976 protected UserTrackerPersistence userTrackerPersistence;
977 @BeanReference(type = UserTrackerPathPersistence.class)
978 protected UserTrackerPathPersistence userTrackerPathPersistence;
979 @BeanReference(type = VirtualHostPersistence.class)
980 protected VirtualHostPersistence virtualHostPersistence;
981 @BeanReference(type = WebDAVPropsPersistence.class)
982 protected WebDAVPropsPersistence webDAVPropsPersistence;
983 @BeanReference(type = WebsitePersistence.class)
984 protected WebsitePersistence websitePersistence;
985 @BeanReference(type = WorkflowDefinitionLinkPersistence.class)
986 protected WorkflowDefinitionLinkPersistence workflowDefinitionLinkPersistence;
987 @BeanReference(type = WorkflowInstanceLinkPersistence.class)
988 protected WorkflowInstanceLinkPersistence workflowInstanceLinkPersistence;
989 private static final String _SQL_SELECT_CLASSNAME = "SELECT className FROM ClassName className";
990 private static final String _SQL_SELECT_CLASSNAME_WHERE = "SELECT className FROM ClassName className WHERE ";
991 private static final String _SQL_COUNT_CLASSNAME = "SELECT COUNT(className) FROM ClassName className";
992 private static final String _SQL_COUNT_CLASSNAME_WHERE = "SELECT COUNT(className) FROM ClassName className WHERE ";
993 private static final String _FINDER_COLUMN_VALUE_VALUE_1 = "className.value IS NULL";
994 private static final String _FINDER_COLUMN_VALUE_VALUE_2 = "className.value = ?";
995 private static final String _FINDER_COLUMN_VALUE_VALUE_3 = "(className.value IS NULL OR className.value = ?)";
996 private static final String _ORDER_BY_ENTITY_ALIAS = "className.";
997 private static final String _NO_SUCH_ENTITY_WITH_PRIMARY_KEY = "No ClassName exists with the primary key ";
998 private static final String _NO_SUCH_ENTITY_WITH_KEY = "No ClassName exists with the key {";
999 private static final boolean _HIBERNATE_CACHE_USE_SECOND_LEVEL_CACHE = com.liferay.portal.util.PropsValues.HIBERNATE_CACHE_USE_SECOND_LEVEL_CACHE;
1000 private static Log _log = LogFactoryUtil.getLog(ClassNamePersistenceImpl.class);
1001 private static ClassName _nullClassName = new ClassNameImpl() {
1002 @Override
1003 public Object clone() {
1004 return this;
1005 }
1006
1007 @Override
1008 public CacheModel<ClassName> toCacheModel() {
1009 return _nullClassNameCacheModel;
1010 }
1011 };
1012
1013 private static CacheModel<ClassName> _nullClassNameCacheModel = new CacheModel<ClassName>() {
1014 public ClassName toEntityModel() {
1015 return _nullClassName;
1016 }
1017 };
1018 }