001
014
015 package com.liferay.portal.service.persistence;
016
017 import com.liferay.portal.NoSuchModelException;
018 import com.liferay.portal.NoSuchWebDAVPropsException;
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.WebDAVProps;
040 import com.liferay.portal.model.impl.WebDAVPropsImpl;
041 import com.liferay.portal.model.impl.WebDAVPropsModelImpl;
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 WebDAVPropsPersistenceImpl extends BasePersistenceImpl<WebDAVProps>
063 implements WebDAVPropsPersistence {
064
069 public static final String FINDER_CLASS_NAME_ENTITY = WebDAVPropsImpl.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_C_C = new FinderPath(WebDAVPropsModelImpl.ENTITY_CACHE_ENABLED,
075 WebDAVPropsModelImpl.FINDER_CACHE_ENABLED, WebDAVPropsImpl.class,
076 FINDER_CLASS_NAME_ENTITY, "fetchByC_C",
077 new String[] { Long.class.getName(), Long.class.getName() },
078 WebDAVPropsModelImpl.CLASSNAMEID_COLUMN_BITMASK |
079 WebDAVPropsModelImpl.CLASSPK_COLUMN_BITMASK);
080 public static final FinderPath FINDER_PATH_COUNT_BY_C_C = new FinderPath(WebDAVPropsModelImpl.ENTITY_CACHE_ENABLED,
081 WebDAVPropsModelImpl.FINDER_CACHE_ENABLED, Long.class,
082 FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "countByC_C",
083 new String[] { Long.class.getName(), Long.class.getName() });
084 public static final FinderPath FINDER_PATH_WITH_PAGINATION_FIND_ALL = new FinderPath(WebDAVPropsModelImpl.ENTITY_CACHE_ENABLED,
085 WebDAVPropsModelImpl.FINDER_CACHE_ENABLED, WebDAVPropsImpl.class,
086 FINDER_CLASS_NAME_LIST_WITH_PAGINATION, "findAll", new String[0]);
087 public static final FinderPath FINDER_PATH_WITHOUT_PAGINATION_FIND_ALL = new FinderPath(WebDAVPropsModelImpl.ENTITY_CACHE_ENABLED,
088 WebDAVPropsModelImpl.FINDER_CACHE_ENABLED, WebDAVPropsImpl.class,
089 FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "findAll", new String[0]);
090 public static final FinderPath FINDER_PATH_COUNT_ALL = new FinderPath(WebDAVPropsModelImpl.ENTITY_CACHE_ENABLED,
091 WebDAVPropsModelImpl.FINDER_CACHE_ENABLED, Long.class,
092 FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "countAll", new String[0]);
093
094
099 public void cacheResult(WebDAVProps webDAVProps) {
100 EntityCacheUtil.putResult(WebDAVPropsModelImpl.ENTITY_CACHE_ENABLED,
101 WebDAVPropsImpl.class, webDAVProps.getPrimaryKey(), webDAVProps);
102
103 FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_C_C,
104 new Object[] {
105 Long.valueOf(webDAVProps.getClassNameId()),
106 Long.valueOf(webDAVProps.getClassPK())
107 }, webDAVProps);
108
109 webDAVProps.resetOriginalValues();
110 }
111
112
117 public void cacheResult(List<WebDAVProps> webDAVPropses) {
118 for (WebDAVProps webDAVProps : webDAVPropses) {
119 if (EntityCacheUtil.getResult(
120 WebDAVPropsModelImpl.ENTITY_CACHE_ENABLED,
121 WebDAVPropsImpl.class, webDAVProps.getPrimaryKey()) == null) {
122 cacheResult(webDAVProps);
123 }
124 else {
125 webDAVProps.resetOriginalValues();
126 }
127 }
128 }
129
130
137 @Override
138 public void clearCache() {
139 if (_HIBERNATE_CACHE_USE_SECOND_LEVEL_CACHE) {
140 CacheRegistryUtil.clear(WebDAVPropsImpl.class.getName());
141 }
142
143 EntityCacheUtil.clearCache(WebDAVPropsImpl.class.getName());
144
145 FinderCacheUtil.clearCache(FINDER_CLASS_NAME_ENTITY);
146 FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
147 FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
148 }
149
150
157 @Override
158 public void clearCache(WebDAVProps webDAVProps) {
159 EntityCacheUtil.removeResult(WebDAVPropsModelImpl.ENTITY_CACHE_ENABLED,
160 WebDAVPropsImpl.class, webDAVProps.getPrimaryKey());
161
162 FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
163 FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
164
165 clearUniqueFindersCache(webDAVProps);
166 }
167
168 @Override
169 public void clearCache(List<WebDAVProps> webDAVPropses) {
170 FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
171 FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
172
173 for (WebDAVProps webDAVProps : webDAVPropses) {
174 EntityCacheUtil.removeResult(WebDAVPropsModelImpl.ENTITY_CACHE_ENABLED,
175 WebDAVPropsImpl.class, webDAVProps.getPrimaryKey());
176
177 clearUniqueFindersCache(webDAVProps);
178 }
179 }
180
181 protected void clearUniqueFindersCache(WebDAVProps webDAVProps) {
182 FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_C_C,
183 new Object[] {
184 Long.valueOf(webDAVProps.getClassNameId()),
185 Long.valueOf(webDAVProps.getClassPK())
186 });
187 }
188
189
195 public WebDAVProps create(long webDavPropsId) {
196 WebDAVProps webDAVProps = new WebDAVPropsImpl();
197
198 webDAVProps.setNew(true);
199 webDAVProps.setPrimaryKey(webDavPropsId);
200
201 return webDAVProps;
202 }
203
204
212 public WebDAVProps remove(long webDavPropsId)
213 throws NoSuchWebDAVPropsException, SystemException {
214 return remove(Long.valueOf(webDavPropsId));
215 }
216
217
225 @Override
226 public WebDAVProps remove(Serializable primaryKey)
227 throws NoSuchWebDAVPropsException, SystemException {
228 Session session = null;
229
230 try {
231 session = openSession();
232
233 WebDAVProps webDAVProps = (WebDAVProps)session.get(WebDAVPropsImpl.class,
234 primaryKey);
235
236 if (webDAVProps == null) {
237 if (_log.isWarnEnabled()) {
238 _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey);
239 }
240
241 throw new NoSuchWebDAVPropsException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
242 primaryKey);
243 }
244
245 return remove(webDAVProps);
246 }
247 catch (NoSuchWebDAVPropsException nsee) {
248 throw nsee;
249 }
250 catch (Exception e) {
251 throw processException(e);
252 }
253 finally {
254 closeSession(session);
255 }
256 }
257
258 @Override
259 protected WebDAVProps removeImpl(WebDAVProps webDAVProps)
260 throws SystemException {
261 webDAVProps = toUnwrappedModel(webDAVProps);
262
263 Session session = null;
264
265 try {
266 session = openSession();
267
268 BatchSessionUtil.delete(session, webDAVProps);
269 }
270 catch (Exception e) {
271 throw processException(e);
272 }
273 finally {
274 closeSession(session);
275 }
276
277 clearCache(webDAVProps);
278
279 return webDAVProps;
280 }
281
282 @Override
283 public WebDAVProps updateImpl(
284 com.liferay.portal.model.WebDAVProps webDAVProps, boolean merge)
285 throws SystemException {
286 webDAVProps = toUnwrappedModel(webDAVProps);
287
288 boolean isNew = webDAVProps.isNew();
289
290 WebDAVPropsModelImpl webDAVPropsModelImpl = (WebDAVPropsModelImpl)webDAVProps;
291
292 Session session = null;
293
294 try {
295 session = openSession();
296
297 BatchSessionUtil.update(session, webDAVProps, merge);
298
299 webDAVProps.setNew(false);
300 }
301 catch (Exception e) {
302 throw processException(e);
303 }
304 finally {
305 closeSession(session);
306 }
307
308 FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
309
310 if (isNew || !WebDAVPropsModelImpl.COLUMN_BITMASK_ENABLED) {
311 FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
312 }
313
314 EntityCacheUtil.putResult(WebDAVPropsModelImpl.ENTITY_CACHE_ENABLED,
315 WebDAVPropsImpl.class, webDAVProps.getPrimaryKey(), webDAVProps);
316
317 if (isNew) {
318 FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_C_C,
319 new Object[] {
320 Long.valueOf(webDAVProps.getClassNameId()),
321 Long.valueOf(webDAVProps.getClassPK())
322 }, webDAVProps);
323 }
324 else {
325 if ((webDAVPropsModelImpl.getColumnBitmask() &
326 FINDER_PATH_FETCH_BY_C_C.getColumnBitmask()) != 0) {
327 Object[] args = new Object[] {
328 Long.valueOf(webDAVPropsModelImpl.getOriginalClassNameId()),
329 Long.valueOf(webDAVPropsModelImpl.getOriginalClassPK())
330 };
331
332 FinderCacheUtil.removeResult(FINDER_PATH_COUNT_BY_C_C, args);
333
334 FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_C_C, args);
335
336 FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_C_C,
337 new Object[] {
338 Long.valueOf(webDAVProps.getClassNameId()),
339 Long.valueOf(webDAVProps.getClassPK())
340 }, webDAVProps);
341 }
342 }
343
344 return webDAVProps;
345 }
346
347 protected WebDAVProps toUnwrappedModel(WebDAVProps webDAVProps) {
348 if (webDAVProps instanceof WebDAVPropsImpl) {
349 return webDAVProps;
350 }
351
352 WebDAVPropsImpl webDAVPropsImpl = new WebDAVPropsImpl();
353
354 webDAVPropsImpl.setNew(webDAVProps.isNew());
355 webDAVPropsImpl.setPrimaryKey(webDAVProps.getPrimaryKey());
356
357 webDAVPropsImpl.setWebDavPropsId(webDAVProps.getWebDavPropsId());
358 webDAVPropsImpl.setCompanyId(webDAVProps.getCompanyId());
359 webDAVPropsImpl.setCreateDate(webDAVProps.getCreateDate());
360 webDAVPropsImpl.setModifiedDate(webDAVProps.getModifiedDate());
361 webDAVPropsImpl.setClassNameId(webDAVProps.getClassNameId());
362 webDAVPropsImpl.setClassPK(webDAVProps.getClassPK());
363 webDAVPropsImpl.setProps(webDAVProps.getProps());
364
365 return webDAVPropsImpl;
366 }
367
368
376 @Override
377 public WebDAVProps findByPrimaryKey(Serializable primaryKey)
378 throws NoSuchModelException, SystemException {
379 return findByPrimaryKey(((Long)primaryKey).longValue());
380 }
381
382
390 public WebDAVProps findByPrimaryKey(long webDavPropsId)
391 throws NoSuchWebDAVPropsException, SystemException {
392 WebDAVProps webDAVProps = fetchByPrimaryKey(webDavPropsId);
393
394 if (webDAVProps == null) {
395 if (_log.isWarnEnabled()) {
396 _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + webDavPropsId);
397 }
398
399 throw new NoSuchWebDAVPropsException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
400 webDavPropsId);
401 }
402
403 return webDAVProps;
404 }
405
406
413 @Override
414 public WebDAVProps fetchByPrimaryKey(Serializable primaryKey)
415 throws SystemException {
416 return fetchByPrimaryKey(((Long)primaryKey).longValue());
417 }
418
419
426 public WebDAVProps fetchByPrimaryKey(long webDavPropsId)
427 throws SystemException {
428 WebDAVProps webDAVProps = (WebDAVProps)EntityCacheUtil.getResult(WebDAVPropsModelImpl.ENTITY_CACHE_ENABLED,
429 WebDAVPropsImpl.class, webDavPropsId);
430
431 if (webDAVProps == _nullWebDAVProps) {
432 return null;
433 }
434
435 if (webDAVProps == null) {
436 Session session = null;
437
438 boolean hasException = false;
439
440 try {
441 session = openSession();
442
443 webDAVProps = (WebDAVProps)session.get(WebDAVPropsImpl.class,
444 Long.valueOf(webDavPropsId));
445 }
446 catch (Exception e) {
447 hasException = true;
448
449 throw processException(e);
450 }
451 finally {
452 if (webDAVProps != null) {
453 cacheResult(webDAVProps);
454 }
455 else if (!hasException) {
456 EntityCacheUtil.putResult(WebDAVPropsModelImpl.ENTITY_CACHE_ENABLED,
457 WebDAVPropsImpl.class, webDavPropsId, _nullWebDAVProps);
458 }
459
460 closeSession(session);
461 }
462 }
463
464 return webDAVProps;
465 }
466
467
476 public WebDAVProps findByC_C(long classNameId, long classPK)
477 throws NoSuchWebDAVPropsException, SystemException {
478 WebDAVProps webDAVProps = fetchByC_C(classNameId, classPK);
479
480 if (webDAVProps == null) {
481 StringBundler msg = new StringBundler(6);
482
483 msg.append(_NO_SUCH_ENTITY_WITH_KEY);
484
485 msg.append("classNameId=");
486 msg.append(classNameId);
487
488 msg.append(", classPK=");
489 msg.append(classPK);
490
491 msg.append(StringPool.CLOSE_CURLY_BRACE);
492
493 if (_log.isWarnEnabled()) {
494 _log.warn(msg.toString());
495 }
496
497 throw new NoSuchWebDAVPropsException(msg.toString());
498 }
499
500 return webDAVProps;
501 }
502
503
511 public WebDAVProps fetchByC_C(long classNameId, long classPK)
512 throws SystemException {
513 return fetchByC_C(classNameId, classPK, true);
514 }
515
516
525 public WebDAVProps fetchByC_C(long classNameId, long classPK,
526 boolean retrieveFromCache) throws SystemException {
527 Object[] finderArgs = new Object[] { classNameId, classPK };
528
529 Object result = null;
530
531 if (retrieveFromCache) {
532 result = FinderCacheUtil.getResult(FINDER_PATH_FETCH_BY_C_C,
533 finderArgs, this);
534 }
535
536 if (result instanceof WebDAVProps) {
537 WebDAVProps webDAVProps = (WebDAVProps)result;
538
539 if ((classNameId != webDAVProps.getClassNameId()) ||
540 (classPK != webDAVProps.getClassPK())) {
541 result = null;
542 }
543 }
544
545 if (result == null) {
546 StringBundler query = new StringBundler(3);
547
548 query.append(_SQL_SELECT_WEBDAVPROPS_WHERE);
549
550 query.append(_FINDER_COLUMN_C_C_CLASSNAMEID_2);
551
552 query.append(_FINDER_COLUMN_C_C_CLASSPK_2);
553
554 String sql = query.toString();
555
556 Session session = null;
557
558 try {
559 session = openSession();
560
561 Query q = session.createQuery(sql);
562
563 QueryPos qPos = QueryPos.getInstance(q);
564
565 qPos.add(classNameId);
566
567 qPos.add(classPK);
568
569 List<WebDAVProps> list = q.list();
570
571 result = list;
572
573 WebDAVProps webDAVProps = null;
574
575 if (list.isEmpty()) {
576 FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_C_C,
577 finderArgs, list);
578 }
579 else {
580 webDAVProps = list.get(0);
581
582 cacheResult(webDAVProps);
583
584 if ((webDAVProps.getClassNameId() != classNameId) ||
585 (webDAVProps.getClassPK() != classPK)) {
586 FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_C_C,
587 finderArgs, webDAVProps);
588 }
589 }
590
591 return webDAVProps;
592 }
593 catch (Exception e) {
594 throw processException(e);
595 }
596 finally {
597 if (result == null) {
598 FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_C_C,
599 finderArgs);
600 }
601
602 closeSession(session);
603 }
604 }
605 else {
606 if (result instanceof List<?>) {
607 return null;
608 }
609 else {
610 return (WebDAVProps)result;
611 }
612 }
613 }
614
615
621 public List<WebDAVProps> findAll() throws SystemException {
622 return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
623 }
624
625
637 public List<WebDAVProps> findAll(int start, int end)
638 throws SystemException {
639 return findAll(start, end, null);
640 }
641
642
655 public List<WebDAVProps> findAll(int start, int end,
656 OrderByComparator orderByComparator) throws SystemException {
657 FinderPath finderPath = null;
658 Object[] finderArgs = new Object[] { start, end, orderByComparator };
659
660 if ((start == QueryUtil.ALL_POS) && (end == QueryUtil.ALL_POS) &&
661 (orderByComparator == null)) {
662 finderPath = FINDER_PATH_WITHOUT_PAGINATION_FIND_ALL;
663 finderArgs = FINDER_ARGS_EMPTY;
664 }
665 else {
666 finderPath = FINDER_PATH_WITH_PAGINATION_FIND_ALL;
667 finderArgs = new Object[] { start, end, orderByComparator };
668 }
669
670 List<WebDAVProps> list = (List<WebDAVProps>)FinderCacheUtil.getResult(finderPath,
671 finderArgs, this);
672
673 if (list == null) {
674 StringBundler query = null;
675 String sql = null;
676
677 if (orderByComparator != null) {
678 query = new StringBundler(2 +
679 (orderByComparator.getOrderByFields().length * 3));
680
681 query.append(_SQL_SELECT_WEBDAVPROPS);
682
683 appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
684 orderByComparator);
685
686 sql = query.toString();
687 }
688 else {
689 sql = _SQL_SELECT_WEBDAVPROPS;
690 }
691
692 Session session = null;
693
694 try {
695 session = openSession();
696
697 Query q = session.createQuery(sql);
698
699 if (orderByComparator == null) {
700 list = (List<WebDAVProps>)QueryUtil.list(q, getDialect(),
701 start, end, false);
702
703 Collections.sort(list);
704 }
705 else {
706 list = (List<WebDAVProps>)QueryUtil.list(q, getDialect(),
707 start, end);
708 }
709 }
710 catch (Exception e) {
711 throw processException(e);
712 }
713 finally {
714 if (list == null) {
715 FinderCacheUtil.removeResult(finderPath, finderArgs);
716 }
717 else {
718 cacheResult(list);
719
720 FinderCacheUtil.putResult(finderPath, finderArgs, list);
721 }
722
723 closeSession(session);
724 }
725 }
726
727 return list;
728 }
729
730
738 public WebDAVProps removeByC_C(long classNameId, long classPK)
739 throws NoSuchWebDAVPropsException, SystemException {
740 WebDAVProps webDAVProps = findByC_C(classNameId, classPK);
741
742 return remove(webDAVProps);
743 }
744
745
750 public void removeAll() throws SystemException {
751 for (WebDAVProps webDAVProps : findAll()) {
752 remove(webDAVProps);
753 }
754 }
755
756
764 public int countByC_C(long classNameId, long classPK)
765 throws SystemException {
766 Object[] finderArgs = new Object[] { classNameId, classPK };
767
768 Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_C_C,
769 finderArgs, this);
770
771 if (count == null) {
772 StringBundler query = new StringBundler(3);
773
774 query.append(_SQL_COUNT_WEBDAVPROPS_WHERE);
775
776 query.append(_FINDER_COLUMN_C_C_CLASSNAMEID_2);
777
778 query.append(_FINDER_COLUMN_C_C_CLASSPK_2);
779
780 String sql = query.toString();
781
782 Session session = null;
783
784 try {
785 session = openSession();
786
787 Query q = session.createQuery(sql);
788
789 QueryPos qPos = QueryPos.getInstance(q);
790
791 qPos.add(classNameId);
792
793 qPos.add(classPK);
794
795 count = (Long)q.uniqueResult();
796 }
797 catch (Exception e) {
798 throw processException(e);
799 }
800 finally {
801 if (count == null) {
802 count = Long.valueOf(0);
803 }
804
805 FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_C_C, finderArgs,
806 count);
807
808 closeSession(session);
809 }
810 }
811
812 return count.intValue();
813 }
814
815
821 public int countAll() throws SystemException {
822 Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_ALL,
823 FINDER_ARGS_EMPTY, this);
824
825 if (count == null) {
826 Session session = null;
827
828 try {
829 session = openSession();
830
831 Query q = session.createQuery(_SQL_COUNT_WEBDAVPROPS);
832
833 count = (Long)q.uniqueResult();
834 }
835 catch (Exception e) {
836 throw processException(e);
837 }
838 finally {
839 if (count == null) {
840 count = Long.valueOf(0);
841 }
842
843 FinderCacheUtil.putResult(FINDER_PATH_COUNT_ALL,
844 FINDER_ARGS_EMPTY, count);
845
846 closeSession(session);
847 }
848 }
849
850 return count.intValue();
851 }
852
853
856 public void afterPropertiesSet() {
857 String[] listenerClassNames = StringUtil.split(GetterUtil.getString(
858 com.liferay.portal.util.PropsUtil.get(
859 "value.object.listener.com.liferay.portal.model.WebDAVProps")));
860
861 if (listenerClassNames.length > 0) {
862 try {
863 List<ModelListener<WebDAVProps>> listenersList = new ArrayList<ModelListener<WebDAVProps>>();
864
865 for (String listenerClassName : listenerClassNames) {
866 listenersList.add((ModelListener<WebDAVProps>)InstanceFactory.newInstance(
867 listenerClassName));
868 }
869
870 listeners = listenersList.toArray(new ModelListener[listenersList.size()]);
871 }
872 catch (Exception e) {
873 _log.error(e);
874 }
875 }
876 }
877
878 public void destroy() {
879 EntityCacheUtil.removeCache(WebDAVPropsImpl.class.getName());
880 FinderCacheUtil.removeCache(FINDER_CLASS_NAME_ENTITY);
881 FinderCacheUtil.removeCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
882 }
883
884 @BeanReference(type = AccountPersistence.class)
885 protected AccountPersistence accountPersistence;
886 @BeanReference(type = AddressPersistence.class)
887 protected AddressPersistence addressPersistence;
888 @BeanReference(type = BrowserTrackerPersistence.class)
889 protected BrowserTrackerPersistence browserTrackerPersistence;
890 @BeanReference(type = ClassNamePersistence.class)
891 protected ClassNamePersistence classNamePersistence;
892 @BeanReference(type = ClusterGroupPersistence.class)
893 protected ClusterGroupPersistence clusterGroupPersistence;
894 @BeanReference(type = CompanyPersistence.class)
895 protected CompanyPersistence companyPersistence;
896 @BeanReference(type = ContactPersistence.class)
897 protected ContactPersistence contactPersistence;
898 @BeanReference(type = CountryPersistence.class)
899 protected CountryPersistence countryPersistence;
900 @BeanReference(type = EmailAddressPersistence.class)
901 protected EmailAddressPersistence emailAddressPersistence;
902 @BeanReference(type = GroupPersistence.class)
903 protected GroupPersistence groupPersistence;
904 @BeanReference(type = ImagePersistence.class)
905 protected ImagePersistence imagePersistence;
906 @BeanReference(type = LayoutPersistence.class)
907 protected LayoutPersistence layoutPersistence;
908 @BeanReference(type = LayoutBranchPersistence.class)
909 protected LayoutBranchPersistence layoutBranchPersistence;
910 @BeanReference(type = LayoutPrototypePersistence.class)
911 protected LayoutPrototypePersistence layoutPrototypePersistence;
912 @BeanReference(type = LayoutRevisionPersistence.class)
913 protected LayoutRevisionPersistence layoutRevisionPersistence;
914 @BeanReference(type = LayoutSetPersistence.class)
915 protected LayoutSetPersistence layoutSetPersistence;
916 @BeanReference(type = LayoutSetBranchPersistence.class)
917 protected LayoutSetBranchPersistence layoutSetBranchPersistence;
918 @BeanReference(type = LayoutSetPrototypePersistence.class)
919 protected LayoutSetPrototypePersistence layoutSetPrototypePersistence;
920 @BeanReference(type = ListTypePersistence.class)
921 protected ListTypePersistence listTypePersistence;
922 @BeanReference(type = LockPersistence.class)
923 protected LockPersistence lockPersistence;
924 @BeanReference(type = MembershipRequestPersistence.class)
925 protected MembershipRequestPersistence membershipRequestPersistence;
926 @BeanReference(type = OrganizationPersistence.class)
927 protected OrganizationPersistence organizationPersistence;
928 @BeanReference(type = OrgGroupPermissionPersistence.class)
929 protected OrgGroupPermissionPersistence orgGroupPermissionPersistence;
930 @BeanReference(type = OrgGroupRolePersistence.class)
931 protected OrgGroupRolePersistence orgGroupRolePersistence;
932 @BeanReference(type = OrgLaborPersistence.class)
933 protected OrgLaborPersistence orgLaborPersistence;
934 @BeanReference(type = PasswordPolicyPersistence.class)
935 protected PasswordPolicyPersistence passwordPolicyPersistence;
936 @BeanReference(type = PasswordPolicyRelPersistence.class)
937 protected PasswordPolicyRelPersistence passwordPolicyRelPersistence;
938 @BeanReference(type = PasswordTrackerPersistence.class)
939 protected PasswordTrackerPersistence passwordTrackerPersistence;
940 @BeanReference(type = PermissionPersistence.class)
941 protected PermissionPersistence permissionPersistence;
942 @BeanReference(type = PhonePersistence.class)
943 protected PhonePersistence phonePersistence;
944 @BeanReference(type = PluginSettingPersistence.class)
945 protected PluginSettingPersistence pluginSettingPersistence;
946 @BeanReference(type = PortalPreferencesPersistence.class)
947 protected PortalPreferencesPersistence portalPreferencesPersistence;
948 @BeanReference(type = PortletPersistence.class)
949 protected PortletPersistence portletPersistence;
950 @BeanReference(type = PortletItemPersistence.class)
951 protected PortletItemPersistence portletItemPersistence;
952 @BeanReference(type = PortletPreferencesPersistence.class)
953 protected PortletPreferencesPersistence portletPreferencesPersistence;
954 @BeanReference(type = RegionPersistence.class)
955 protected RegionPersistence regionPersistence;
956 @BeanReference(type = ReleasePersistence.class)
957 protected ReleasePersistence releasePersistence;
958 @BeanReference(type = RepositoryPersistence.class)
959 protected RepositoryPersistence repositoryPersistence;
960 @BeanReference(type = RepositoryEntryPersistence.class)
961 protected RepositoryEntryPersistence repositoryEntryPersistence;
962 @BeanReference(type = ResourcePersistence.class)
963 protected ResourcePersistence resourcePersistence;
964 @BeanReference(type = ResourceActionPersistence.class)
965 protected ResourceActionPersistence resourceActionPersistence;
966 @BeanReference(type = ResourceBlockPersistence.class)
967 protected ResourceBlockPersistence resourceBlockPersistence;
968 @BeanReference(type = ResourceBlockPermissionPersistence.class)
969 protected ResourceBlockPermissionPersistence resourceBlockPermissionPersistence;
970 @BeanReference(type = ResourceCodePersistence.class)
971 protected ResourceCodePersistence resourceCodePersistence;
972 @BeanReference(type = ResourcePermissionPersistence.class)
973 protected ResourcePermissionPersistence resourcePermissionPersistence;
974 @BeanReference(type = ResourceTypePermissionPersistence.class)
975 protected ResourceTypePermissionPersistence resourceTypePermissionPersistence;
976 @BeanReference(type = RolePersistence.class)
977 protected RolePersistence rolePersistence;
978 @BeanReference(type = ServiceComponentPersistence.class)
979 protected ServiceComponentPersistence serviceComponentPersistence;
980 @BeanReference(type = ShardPersistence.class)
981 protected ShardPersistence shardPersistence;
982 @BeanReference(type = SubscriptionPersistence.class)
983 protected SubscriptionPersistence subscriptionPersistence;
984 @BeanReference(type = TeamPersistence.class)
985 protected TeamPersistence teamPersistence;
986 @BeanReference(type = TicketPersistence.class)
987 protected TicketPersistence ticketPersistence;
988 @BeanReference(type = UserPersistence.class)
989 protected UserPersistence userPersistence;
990 @BeanReference(type = UserGroupPersistence.class)
991 protected UserGroupPersistence userGroupPersistence;
992 @BeanReference(type = UserGroupGroupRolePersistence.class)
993 protected UserGroupGroupRolePersistence userGroupGroupRolePersistence;
994 @BeanReference(type = UserGroupRolePersistence.class)
995 protected UserGroupRolePersistence userGroupRolePersistence;
996 @BeanReference(type = UserIdMapperPersistence.class)
997 protected UserIdMapperPersistence userIdMapperPersistence;
998 @BeanReference(type = UserNotificationEventPersistence.class)
999 protected UserNotificationEventPersistence userNotificationEventPersistence;
1000 @BeanReference(type = UserTrackerPersistence.class)
1001 protected UserTrackerPersistence userTrackerPersistence;
1002 @BeanReference(type = UserTrackerPathPersistence.class)
1003 protected UserTrackerPathPersistence userTrackerPathPersistence;
1004 @BeanReference(type = VirtualHostPersistence.class)
1005 protected VirtualHostPersistence virtualHostPersistence;
1006 @BeanReference(type = WebDAVPropsPersistence.class)
1007 protected WebDAVPropsPersistence webDAVPropsPersistence;
1008 @BeanReference(type = WebsitePersistence.class)
1009 protected WebsitePersistence websitePersistence;
1010 @BeanReference(type = WorkflowDefinitionLinkPersistence.class)
1011 protected WorkflowDefinitionLinkPersistence workflowDefinitionLinkPersistence;
1012 @BeanReference(type = WorkflowInstanceLinkPersistence.class)
1013 protected WorkflowInstanceLinkPersistence workflowInstanceLinkPersistence;
1014 private static final String _SQL_SELECT_WEBDAVPROPS = "SELECT webDAVProps FROM WebDAVProps webDAVProps";
1015 private static final String _SQL_SELECT_WEBDAVPROPS_WHERE = "SELECT webDAVProps FROM WebDAVProps webDAVProps WHERE ";
1016 private static final String _SQL_COUNT_WEBDAVPROPS = "SELECT COUNT(webDAVProps) FROM WebDAVProps webDAVProps";
1017 private static final String _SQL_COUNT_WEBDAVPROPS_WHERE = "SELECT COUNT(webDAVProps) FROM WebDAVProps webDAVProps WHERE ";
1018 private static final String _FINDER_COLUMN_C_C_CLASSNAMEID_2 = "webDAVProps.classNameId = ? AND ";
1019 private static final String _FINDER_COLUMN_C_C_CLASSPK_2 = "webDAVProps.classPK = ?";
1020 private static final String _ORDER_BY_ENTITY_ALIAS = "webDAVProps.";
1021 private static final String _NO_SUCH_ENTITY_WITH_PRIMARY_KEY = "No WebDAVProps exists with the primary key ";
1022 private static final String _NO_SUCH_ENTITY_WITH_KEY = "No WebDAVProps exists with the key {";
1023 private static final boolean _HIBERNATE_CACHE_USE_SECOND_LEVEL_CACHE = com.liferay.portal.util.PropsValues.HIBERNATE_CACHE_USE_SECOND_LEVEL_CACHE;
1024 private static Log _log = LogFactoryUtil.getLog(WebDAVPropsPersistenceImpl.class);
1025 private static WebDAVProps _nullWebDAVProps = new WebDAVPropsImpl() {
1026 @Override
1027 public Object clone() {
1028 return this;
1029 }
1030
1031 @Override
1032 public CacheModel<WebDAVProps> toCacheModel() {
1033 return _nullWebDAVPropsCacheModel;
1034 }
1035 };
1036
1037 private static CacheModel<WebDAVProps> _nullWebDAVPropsCacheModel = new CacheModel<WebDAVProps>() {
1038 public WebDAVProps toEntityModel() {
1039 return _nullWebDAVProps;
1040 }
1041 };
1042 }