1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    * Permission is hereby granted, free of charge, to any person obtaining a copy
5    * of this software and associated documentation files (the "Software"), to deal
6    * in the Software without restriction, including without limitation the rights
7    * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8    * copies of the Software, and to permit persons to whom the Software is
9    * furnished to do so, subject to the following conditions:
10   *
11   * The above copyright notice and this permission notice shall be included in
12   * all copies or substantial portions of the Software.
13   *
14   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20   * SOFTWARE.
21   */
22  
23  package com.liferay.portal.service.persistence;
24  
25  import com.liferay.portal.NoSuchWebDAVPropsException;
26  import com.liferay.portal.SystemException;
27  import com.liferay.portal.kernel.annotation.BeanReference;
28  import com.liferay.portal.kernel.cache.CacheRegistry;
29  import com.liferay.portal.kernel.dao.orm.DynamicQuery;
30  import com.liferay.portal.kernel.dao.orm.EntityCacheUtil;
31  import com.liferay.portal.kernel.dao.orm.FinderCacheUtil;
32  import com.liferay.portal.kernel.dao.orm.FinderPath;
33  import com.liferay.portal.kernel.dao.orm.Query;
34  import com.liferay.portal.kernel.dao.orm.QueryPos;
35  import com.liferay.portal.kernel.dao.orm.QueryUtil;
36  import com.liferay.portal.kernel.dao.orm.Session;
37  import com.liferay.portal.kernel.log.Log;
38  import com.liferay.portal.kernel.log.LogFactoryUtil;
39  import com.liferay.portal.kernel.util.GetterUtil;
40  import com.liferay.portal.kernel.util.OrderByComparator;
41  import com.liferay.portal.kernel.util.StringPool;
42  import com.liferay.portal.kernel.util.StringUtil;
43  import com.liferay.portal.model.ModelListener;
44  import com.liferay.portal.model.WebDAVProps;
45  import com.liferay.portal.model.impl.WebDAVPropsImpl;
46  import com.liferay.portal.model.impl.WebDAVPropsModelImpl;
47  import com.liferay.portal.service.persistence.impl.BasePersistenceImpl;
48  
49  import java.util.ArrayList;
50  import java.util.Collections;
51  import java.util.List;
52  
53  /**
54   * <a href="WebDAVPropsPersistenceImpl.java.html"><b><i>View Source</i></b></a>
55   *
56   * @author Brian Wing Shun Chan
57   *
58   */
59  public class WebDAVPropsPersistenceImpl extends BasePersistenceImpl
60      implements WebDAVPropsPersistence {
61      public static final String FINDER_CLASS_NAME_ENTITY = WebDAVPropsImpl.class.getName();
62      public static final String FINDER_CLASS_NAME_LIST = FINDER_CLASS_NAME_ENTITY +
63          ".List";
64      public static final FinderPath FINDER_PATH_FETCH_BY_C_C = new FinderPath(WebDAVPropsModelImpl.ENTITY_CACHE_ENABLED,
65              WebDAVPropsModelImpl.FINDER_CACHE_ENABLED,
66              FINDER_CLASS_NAME_ENTITY, "fetchByC_C",
67              new String[] { Long.class.getName(), Long.class.getName() });
68      public static final FinderPath FINDER_PATH_COUNT_BY_C_C = new FinderPath(WebDAVPropsModelImpl.ENTITY_CACHE_ENABLED,
69              WebDAVPropsModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
70              "countByC_C",
71              new String[] { Long.class.getName(), Long.class.getName() });
72      public static final FinderPath FINDER_PATH_FIND_ALL = new FinderPath(WebDAVPropsModelImpl.ENTITY_CACHE_ENABLED,
73              WebDAVPropsModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
74              "findAll", new String[0]);
75      public static final FinderPath FINDER_PATH_COUNT_ALL = new FinderPath(WebDAVPropsModelImpl.ENTITY_CACHE_ENABLED,
76              WebDAVPropsModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
77              "countAll", new String[0]);
78  
79      public void cacheResult(WebDAVProps webDAVProps) {
80          EntityCacheUtil.putResult(WebDAVPropsModelImpl.ENTITY_CACHE_ENABLED,
81              WebDAVPropsImpl.class, webDAVProps.getPrimaryKey(), webDAVProps);
82  
83          FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_C_C,
84              new Object[] {
85                  new Long(webDAVProps.getClassNameId()),
86                  new Long(webDAVProps.getClassPK())
87              }, webDAVProps);
88      }
89  
90      public void cacheResult(List<WebDAVProps> webDAVPropses) {
91          for (WebDAVProps webDAVProps : webDAVPropses) {
92              if (EntityCacheUtil.getResult(
93                          WebDAVPropsModelImpl.ENTITY_CACHE_ENABLED,
94                          WebDAVPropsImpl.class, webDAVProps.getPrimaryKey(), this) == null) {
95                  cacheResult(webDAVProps);
96              }
97          }
98      }
99  
100     public void clearCache() {
101         CacheRegistry.clear(WebDAVPropsImpl.class.getName());
102         EntityCacheUtil.clearCache(WebDAVPropsImpl.class.getName());
103         FinderCacheUtil.clearCache(FINDER_CLASS_NAME_ENTITY);
104         FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST);
105     }
106 
107     public WebDAVProps create(long webDavPropsId) {
108         WebDAVProps webDAVProps = new WebDAVPropsImpl();
109 
110         webDAVProps.setNew(true);
111         webDAVProps.setPrimaryKey(webDavPropsId);
112 
113         return webDAVProps;
114     }
115 
116     public WebDAVProps remove(long webDavPropsId)
117         throws NoSuchWebDAVPropsException, SystemException {
118         Session session = null;
119 
120         try {
121             session = openSession();
122 
123             WebDAVProps webDAVProps = (WebDAVProps)session.get(WebDAVPropsImpl.class,
124                     new Long(webDavPropsId));
125 
126             if (webDAVProps == null) {
127                 if (_log.isWarnEnabled()) {
128                     _log.warn("No WebDAVProps exists with the primary key " +
129                         webDavPropsId);
130                 }
131 
132                 throw new NoSuchWebDAVPropsException(
133                     "No WebDAVProps exists with the primary key " +
134                     webDavPropsId);
135             }
136 
137             return remove(webDAVProps);
138         }
139         catch (NoSuchWebDAVPropsException nsee) {
140             throw nsee;
141         }
142         catch (Exception e) {
143             throw processException(e);
144         }
145         finally {
146             closeSession(session);
147         }
148     }
149 
150     public WebDAVProps remove(WebDAVProps webDAVProps)
151         throws SystemException {
152         for (ModelListener<WebDAVProps> listener : listeners) {
153             listener.onBeforeRemove(webDAVProps);
154         }
155 
156         webDAVProps = removeImpl(webDAVProps);
157 
158         for (ModelListener<WebDAVProps> listener : listeners) {
159             listener.onAfterRemove(webDAVProps);
160         }
161 
162         return webDAVProps;
163     }
164 
165     protected WebDAVProps removeImpl(WebDAVProps webDAVProps)
166         throws SystemException {
167         Session session = null;
168 
169         try {
170             session = openSession();
171 
172             if (webDAVProps.isCachedModel() || BatchSessionUtil.isEnabled()) {
173                 Object staleObject = session.get(WebDAVPropsImpl.class,
174                         webDAVProps.getPrimaryKeyObj());
175 
176                 if (staleObject != null) {
177                     session.evict(staleObject);
178                 }
179             }
180 
181             session.delete(webDAVProps);
182 
183             session.flush();
184         }
185         catch (Exception e) {
186             throw processException(e);
187         }
188         finally {
189             closeSession(session);
190         }
191 
192         FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST);
193 
194         WebDAVPropsModelImpl webDAVPropsModelImpl = (WebDAVPropsModelImpl)webDAVProps;
195 
196         FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_C_C,
197             new Object[] {
198                 new Long(webDAVPropsModelImpl.getOriginalClassNameId()),
199                 new Long(webDAVPropsModelImpl.getOriginalClassPK())
200             });
201 
202         EntityCacheUtil.removeResult(WebDAVPropsModelImpl.ENTITY_CACHE_ENABLED,
203             WebDAVPropsImpl.class, webDAVProps.getPrimaryKey());
204 
205         return webDAVProps;
206     }
207 
208     /**
209      * @deprecated Use <code>update(WebDAVProps webDAVProps, boolean merge)</code>.
210      */
211     public WebDAVProps update(WebDAVProps webDAVProps)
212         throws SystemException {
213         if (_log.isWarnEnabled()) {
214             _log.warn(
215                 "Using the deprecated update(WebDAVProps webDAVProps) method. Use update(WebDAVProps webDAVProps, boolean merge) instead.");
216         }
217 
218         return update(webDAVProps, false);
219     }
220 
221     /**
222      * Add, update, or merge, the entity. This method also calls the model
223      * listeners to trigger the proper events associated with adding, deleting,
224      * or updating an entity.
225      *
226      * @param        webDAVProps the entity to add, update, or merge
227      * @param        merge boolean value for whether to merge the entity. The
228      *                default value is false. Setting merge to true is more
229      *                expensive and should only be true when webDAVProps is
230      *                transient. See LEP-5473 for a detailed discussion of this
231      *                method.
232      * @return        true if the portlet can be displayed via Ajax
233      */
234     public WebDAVProps update(WebDAVProps webDAVProps, boolean merge)
235         throws SystemException {
236         boolean isNew = webDAVProps.isNew();
237 
238         for (ModelListener<WebDAVProps> listener : listeners) {
239             if (isNew) {
240                 listener.onBeforeCreate(webDAVProps);
241             }
242             else {
243                 listener.onBeforeUpdate(webDAVProps);
244             }
245         }
246 
247         webDAVProps = updateImpl(webDAVProps, merge);
248 
249         for (ModelListener<WebDAVProps> listener : listeners) {
250             if (isNew) {
251                 listener.onAfterCreate(webDAVProps);
252             }
253             else {
254                 listener.onAfterUpdate(webDAVProps);
255             }
256         }
257 
258         return webDAVProps;
259     }
260 
261     public WebDAVProps updateImpl(
262         com.liferay.portal.model.WebDAVProps webDAVProps, boolean merge)
263         throws SystemException {
264         boolean isNew = webDAVProps.isNew();
265 
266         WebDAVPropsModelImpl webDAVPropsModelImpl = (WebDAVPropsModelImpl)webDAVProps;
267 
268         Session session = null;
269 
270         try {
271             session = openSession();
272 
273             BatchSessionUtil.update(session, webDAVProps, merge);
274 
275             webDAVProps.setNew(false);
276         }
277         catch (Exception e) {
278             throw processException(e);
279         }
280         finally {
281             closeSession(session);
282         }
283 
284         FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST);
285 
286         EntityCacheUtil.putResult(WebDAVPropsModelImpl.ENTITY_CACHE_ENABLED,
287             WebDAVPropsImpl.class, webDAVProps.getPrimaryKey(), webDAVProps);
288 
289         if (!isNew &&
290                 ((webDAVProps.getClassNameId() != webDAVPropsModelImpl.getOriginalClassNameId()) ||
291                 (webDAVProps.getClassPK() != webDAVPropsModelImpl.getOriginalClassPK()))) {
292             FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_C_C,
293                 new Object[] {
294                     new Long(webDAVPropsModelImpl.getOriginalClassNameId()),
295                     new Long(webDAVPropsModelImpl.getOriginalClassPK())
296                 });
297         }
298 
299         if (isNew ||
300                 ((webDAVProps.getClassNameId() != webDAVPropsModelImpl.getOriginalClassNameId()) ||
301                 (webDAVProps.getClassPK() != webDAVPropsModelImpl.getOriginalClassPK()))) {
302             FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_C_C,
303                 new Object[] {
304                     new Long(webDAVProps.getClassNameId()),
305                     new Long(webDAVProps.getClassPK())
306                 }, webDAVProps);
307         }
308 
309         return webDAVProps;
310     }
311 
312     public WebDAVProps findByPrimaryKey(long webDavPropsId)
313         throws NoSuchWebDAVPropsException, SystemException {
314         WebDAVProps webDAVProps = fetchByPrimaryKey(webDavPropsId);
315 
316         if (webDAVProps == null) {
317             if (_log.isWarnEnabled()) {
318                 _log.warn("No WebDAVProps exists with the primary key " +
319                     webDavPropsId);
320             }
321 
322             throw new NoSuchWebDAVPropsException(
323                 "No WebDAVProps exists with the primary key " + webDavPropsId);
324         }
325 
326         return webDAVProps;
327     }
328 
329     public WebDAVProps fetchByPrimaryKey(long webDavPropsId)
330         throws SystemException {
331         WebDAVProps webDAVProps = (WebDAVProps)EntityCacheUtil.getResult(WebDAVPropsModelImpl.ENTITY_CACHE_ENABLED,
332                 WebDAVPropsImpl.class, webDavPropsId, this);
333 
334         if (webDAVProps == null) {
335             Session session = null;
336 
337             try {
338                 session = openSession();
339 
340                 webDAVProps = (WebDAVProps)session.get(WebDAVPropsImpl.class,
341                         new Long(webDavPropsId));
342             }
343             catch (Exception e) {
344                 throw processException(e);
345             }
346             finally {
347                 if (webDAVProps != null) {
348                     cacheResult(webDAVProps);
349                 }
350 
351                 closeSession(session);
352             }
353         }
354 
355         return webDAVProps;
356     }
357 
358     public WebDAVProps findByC_C(long classNameId, long classPK)
359         throws NoSuchWebDAVPropsException, SystemException {
360         WebDAVProps webDAVProps = fetchByC_C(classNameId, classPK);
361 
362         if (webDAVProps == null) {
363             StringBuilder msg = new StringBuilder();
364 
365             msg.append("No WebDAVProps exists with the key {");
366 
367             msg.append("classNameId=" + classNameId);
368 
369             msg.append(", ");
370             msg.append("classPK=" + classPK);
371 
372             msg.append(StringPool.CLOSE_CURLY_BRACE);
373 
374             if (_log.isWarnEnabled()) {
375                 _log.warn(msg.toString());
376             }
377 
378             throw new NoSuchWebDAVPropsException(msg.toString());
379         }
380 
381         return webDAVProps;
382     }
383 
384     public WebDAVProps fetchByC_C(long classNameId, long classPK)
385         throws SystemException {
386         return fetchByC_C(classNameId, classPK, true);
387     }
388 
389     public WebDAVProps fetchByC_C(long classNameId, long classPK,
390         boolean retrieveFromCache) throws SystemException {
391         Object[] finderArgs = new Object[] {
392                 new Long(classNameId), new Long(classPK)
393             };
394 
395         Object result = null;
396 
397         if (retrieveFromCache) {
398             result = FinderCacheUtil.getResult(FINDER_PATH_FETCH_BY_C_C,
399                     finderArgs, this);
400         }
401 
402         if (result == null) {
403             Session session = null;
404 
405             try {
406                 session = openSession();
407 
408                 StringBuilder query = new StringBuilder();
409 
410                 query.append(
411                     "SELECT webDAVProps FROM WebDAVProps webDAVProps WHERE ");
412 
413                 query.append("webDAVProps.classNameId = ?");
414 
415                 query.append(" AND ");
416 
417                 query.append("webDAVProps.classPK = ?");
418 
419                 query.append(" ");
420 
421                 Query q = session.createQuery(query.toString());
422 
423                 QueryPos qPos = QueryPos.getInstance(q);
424 
425                 qPos.add(classNameId);
426 
427                 qPos.add(classPK);
428 
429                 List<WebDAVProps> list = q.list();
430 
431                 result = list;
432 
433                 WebDAVProps webDAVProps = null;
434 
435                 if (list.isEmpty()) {
436                     FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_C_C,
437                         finderArgs, list);
438                 }
439                 else {
440                     webDAVProps = list.get(0);
441 
442                     cacheResult(webDAVProps);
443 
444                     if ((webDAVProps.getClassNameId() != classNameId) ||
445                             (webDAVProps.getClassPK() != classPK)) {
446                         FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_C_C,
447                             finderArgs, webDAVProps);
448                     }
449                 }
450 
451                 return webDAVProps;
452             }
453             catch (Exception e) {
454                 throw processException(e);
455             }
456             finally {
457                 if (result == null) {
458                     FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_C_C,
459                         finderArgs, new ArrayList<WebDAVProps>());
460                 }
461 
462                 closeSession(session);
463             }
464         }
465         else {
466             if (result instanceof List) {
467                 return null;
468             }
469             else {
470                 return (WebDAVProps)result;
471             }
472         }
473     }
474 
475     public List<Object> findWithDynamicQuery(DynamicQuery dynamicQuery)
476         throws SystemException {
477         Session session = null;
478 
479         try {
480             session = openSession();
481 
482             dynamicQuery.compile(session);
483 
484             return dynamicQuery.list();
485         }
486         catch (Exception e) {
487             throw processException(e);
488         }
489         finally {
490             closeSession(session);
491         }
492     }
493 
494     public List<Object> findWithDynamicQuery(DynamicQuery dynamicQuery,
495         int start, int end) throws SystemException {
496         Session session = null;
497 
498         try {
499             session = openSession();
500 
501             dynamicQuery.setLimit(start, end);
502 
503             dynamicQuery.compile(session);
504 
505             return dynamicQuery.list();
506         }
507         catch (Exception e) {
508             throw processException(e);
509         }
510         finally {
511             closeSession(session);
512         }
513     }
514 
515     public List<WebDAVProps> findAll() throws SystemException {
516         return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
517     }
518 
519     public List<WebDAVProps> findAll(int start, int end)
520         throws SystemException {
521         return findAll(start, end, null);
522     }
523 
524     public List<WebDAVProps> findAll(int start, int end, OrderByComparator obc)
525         throws SystemException {
526         Object[] finderArgs = new Object[] {
527                 String.valueOf(start), String.valueOf(end), String.valueOf(obc)
528             };
529 
530         List<WebDAVProps> list = (List<WebDAVProps>)FinderCacheUtil.getResult(FINDER_PATH_FIND_ALL,
531                 finderArgs, this);
532 
533         if (list == null) {
534             Session session = null;
535 
536             try {
537                 session = openSession();
538 
539                 StringBuilder query = new StringBuilder();
540 
541                 query.append("SELECT webDAVProps FROM WebDAVProps webDAVProps ");
542 
543                 if (obc != null) {
544                     query.append("ORDER BY ");
545 
546                     String[] orderByFields = obc.getOrderByFields();
547 
548                     for (int i = 0; i < orderByFields.length; i++) {
549                         query.append("webDAVProps.");
550                         query.append(orderByFields[i]);
551 
552                         if (obc.isAscending()) {
553                             query.append(" ASC");
554                         }
555                         else {
556                             query.append(" DESC");
557                         }
558 
559                         if ((i + 1) < orderByFields.length) {
560                             query.append(", ");
561                         }
562                     }
563                 }
564 
565                 Query q = session.createQuery(query.toString());
566 
567                 if (obc == null) {
568                     list = (List<WebDAVProps>)QueryUtil.list(q, getDialect(),
569                             start, end, false);
570 
571                     Collections.sort(list);
572                 }
573                 else {
574                     list = (List<WebDAVProps>)QueryUtil.list(q, getDialect(),
575                             start, end);
576                 }
577             }
578             catch (Exception e) {
579                 throw processException(e);
580             }
581             finally {
582                 if (list == null) {
583                     list = new ArrayList<WebDAVProps>();
584                 }
585 
586                 cacheResult(list);
587 
588                 FinderCacheUtil.putResult(FINDER_PATH_FIND_ALL, finderArgs, list);
589 
590                 closeSession(session);
591             }
592         }
593 
594         return list;
595     }
596 
597     public void removeByC_C(long classNameId, long classPK)
598         throws NoSuchWebDAVPropsException, SystemException {
599         WebDAVProps webDAVProps = findByC_C(classNameId, classPK);
600 
601         remove(webDAVProps);
602     }
603 
604     public void removeAll() throws SystemException {
605         for (WebDAVProps webDAVProps : findAll()) {
606             remove(webDAVProps);
607         }
608     }
609 
610     public int countByC_C(long classNameId, long classPK)
611         throws SystemException {
612         Object[] finderArgs = new Object[] {
613                 new Long(classNameId), new Long(classPK)
614             };
615 
616         Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_C_C,
617                 finderArgs, this);
618 
619         if (count == null) {
620             Session session = null;
621 
622             try {
623                 session = openSession();
624 
625                 StringBuilder query = new StringBuilder();
626 
627                 query.append("SELECT COUNT(webDAVProps) ");
628                 query.append("FROM WebDAVProps webDAVProps WHERE ");
629 
630                 query.append("webDAVProps.classNameId = ?");
631 
632                 query.append(" AND ");
633 
634                 query.append("webDAVProps.classPK = ?");
635 
636                 query.append(" ");
637 
638                 Query q = session.createQuery(query.toString());
639 
640                 QueryPos qPos = QueryPos.getInstance(q);
641 
642                 qPos.add(classNameId);
643 
644                 qPos.add(classPK);
645 
646                 count = (Long)q.uniqueResult();
647             }
648             catch (Exception e) {
649                 throw processException(e);
650             }
651             finally {
652                 if (count == null) {
653                     count = Long.valueOf(0);
654                 }
655 
656                 FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_C_C, finderArgs,
657                     count);
658 
659                 closeSession(session);
660             }
661         }
662 
663         return count.intValue();
664     }
665 
666     public int countAll() throws SystemException {
667         Object[] finderArgs = new Object[0];
668 
669         Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_ALL,
670                 finderArgs, this);
671 
672         if (count == null) {
673             Session session = null;
674 
675             try {
676                 session = openSession();
677 
678                 Query q = session.createQuery(
679                         "SELECT COUNT(webDAVProps) FROM WebDAVProps webDAVProps");
680 
681                 count = (Long)q.uniqueResult();
682             }
683             catch (Exception e) {
684                 throw processException(e);
685             }
686             finally {
687                 if (count == null) {
688                     count = Long.valueOf(0);
689                 }
690 
691                 FinderCacheUtil.putResult(FINDER_PATH_COUNT_ALL, finderArgs,
692                     count);
693 
694                 closeSession(session);
695             }
696         }
697 
698         return count.intValue();
699     }
700 
701     public void afterPropertiesSet() {
702         String[] listenerClassNames = StringUtil.split(GetterUtil.getString(
703                     com.liferay.portal.util.PropsUtil.get(
704                         "value.object.listener.com.liferay.portal.model.WebDAVProps")));
705 
706         if (listenerClassNames.length > 0) {
707             try {
708                 List<ModelListener<WebDAVProps>> listenersList = new ArrayList<ModelListener<WebDAVProps>>();
709 
710                 for (String listenerClassName : listenerClassNames) {
711                     listenersList.add((ModelListener<WebDAVProps>)Class.forName(
712                             listenerClassName).newInstance());
713                 }
714 
715                 listeners = listenersList.toArray(new ModelListener[listenersList.size()]);
716             }
717             catch (Exception e) {
718                 _log.error(e);
719             }
720         }
721     }
722 
723     @BeanReference(name = "com.liferay.portal.service.persistence.AccountPersistence.impl")
724     protected com.liferay.portal.service.persistence.AccountPersistence accountPersistence;
725     @BeanReference(name = "com.liferay.portal.service.persistence.AddressPersistence.impl")
726     protected com.liferay.portal.service.persistence.AddressPersistence addressPersistence;
727     @BeanReference(name = "com.liferay.portal.service.persistence.BrowserTrackerPersistence.impl")
728     protected com.liferay.portal.service.persistence.BrowserTrackerPersistence browserTrackerPersistence;
729     @BeanReference(name = "com.liferay.portal.service.persistence.ClassNamePersistence.impl")
730     protected com.liferay.portal.service.persistence.ClassNamePersistence classNamePersistence;
731     @BeanReference(name = "com.liferay.portal.service.persistence.CompanyPersistence.impl")
732     protected com.liferay.portal.service.persistence.CompanyPersistence companyPersistence;
733     @BeanReference(name = "com.liferay.portal.service.persistence.ContactPersistence.impl")
734     protected com.liferay.portal.service.persistence.ContactPersistence contactPersistence;
735     @BeanReference(name = "com.liferay.portal.service.persistence.CountryPersistence.impl")
736     protected com.liferay.portal.service.persistence.CountryPersistence countryPersistence;
737     @BeanReference(name = "com.liferay.portal.service.persistence.EmailAddressPersistence.impl")
738     protected com.liferay.portal.service.persistence.EmailAddressPersistence emailAddressPersistence;
739     @BeanReference(name = "com.liferay.portal.service.persistence.GroupPersistence.impl")
740     protected com.liferay.portal.service.persistence.GroupPersistence groupPersistence;
741     @BeanReference(name = "com.liferay.portal.service.persistence.ImagePersistence.impl")
742     protected com.liferay.portal.service.persistence.ImagePersistence imagePersistence;
743     @BeanReference(name = "com.liferay.portal.service.persistence.LayoutPersistence.impl")
744     protected com.liferay.portal.service.persistence.LayoutPersistence layoutPersistence;
745     @BeanReference(name = "com.liferay.portal.service.persistence.LayoutSetPersistence.impl")
746     protected com.liferay.portal.service.persistence.LayoutSetPersistence layoutSetPersistence;
747     @BeanReference(name = "com.liferay.portal.service.persistence.ListTypePersistence.impl")
748     protected com.liferay.portal.service.persistence.ListTypePersistence listTypePersistence;
749     @BeanReference(name = "com.liferay.portal.service.persistence.MembershipRequestPersistence.impl")
750     protected com.liferay.portal.service.persistence.MembershipRequestPersistence membershipRequestPersistence;
751     @BeanReference(name = "com.liferay.portal.service.persistence.OrganizationPersistence.impl")
752     protected com.liferay.portal.service.persistence.OrganizationPersistence organizationPersistence;
753     @BeanReference(name = "com.liferay.portal.service.persistence.OrgGroupPermissionPersistence.impl")
754     protected com.liferay.portal.service.persistence.OrgGroupPermissionPersistence orgGroupPermissionPersistence;
755     @BeanReference(name = "com.liferay.portal.service.persistence.OrgGroupRolePersistence.impl")
756     protected com.liferay.portal.service.persistence.OrgGroupRolePersistence orgGroupRolePersistence;
757     @BeanReference(name = "com.liferay.portal.service.persistence.OrgLaborPersistence.impl")
758     protected com.liferay.portal.service.persistence.OrgLaborPersistence orgLaborPersistence;
759     @BeanReference(name = "com.liferay.portal.service.persistence.PasswordPolicyPersistence.impl")
760     protected com.liferay.portal.service.persistence.PasswordPolicyPersistence passwordPolicyPersistence;
761     @BeanReference(name = "com.liferay.portal.service.persistence.PasswordPolicyRelPersistence.impl")
762     protected com.liferay.portal.service.persistence.PasswordPolicyRelPersistence passwordPolicyRelPersistence;
763     @BeanReference(name = "com.liferay.portal.service.persistence.PasswordTrackerPersistence.impl")
764     protected com.liferay.portal.service.persistence.PasswordTrackerPersistence passwordTrackerPersistence;
765     @BeanReference(name = "com.liferay.portal.service.persistence.PermissionPersistence.impl")
766     protected com.liferay.portal.service.persistence.PermissionPersistence permissionPersistence;
767     @BeanReference(name = "com.liferay.portal.service.persistence.PhonePersistence.impl")
768     protected com.liferay.portal.service.persistence.PhonePersistence phonePersistence;
769     @BeanReference(name = "com.liferay.portal.service.persistence.PluginSettingPersistence.impl")
770     protected com.liferay.portal.service.persistence.PluginSettingPersistence pluginSettingPersistence;
771     @BeanReference(name = "com.liferay.portal.service.persistence.PortletPersistence.impl")
772     protected com.liferay.portal.service.persistence.PortletPersistence portletPersistence;
773     @BeanReference(name = "com.liferay.portal.service.persistence.PortletItemPersistence.impl")
774     protected com.liferay.portal.service.persistence.PortletItemPersistence portletItemPersistence;
775     @BeanReference(name = "com.liferay.portal.service.persistence.PortletPreferencesPersistence.impl")
776     protected com.liferay.portal.service.persistence.PortletPreferencesPersistence portletPreferencesPersistence;
777     @BeanReference(name = "com.liferay.portal.service.persistence.RegionPersistence.impl")
778     protected com.liferay.portal.service.persistence.RegionPersistence regionPersistence;
779     @BeanReference(name = "com.liferay.portal.service.persistence.ReleasePersistence.impl")
780     protected com.liferay.portal.service.persistence.ReleasePersistence releasePersistence;
781     @BeanReference(name = "com.liferay.portal.service.persistence.ResourcePersistence.impl")
782     protected com.liferay.portal.service.persistence.ResourcePersistence resourcePersistence;
783     @BeanReference(name = "com.liferay.portal.service.persistence.ResourceActionPersistence.impl")
784     protected com.liferay.portal.service.persistence.ResourceActionPersistence resourceActionPersistence;
785     @BeanReference(name = "com.liferay.portal.service.persistence.ResourceCodePersistence.impl")
786     protected com.liferay.portal.service.persistence.ResourceCodePersistence resourceCodePersistence;
787     @BeanReference(name = "com.liferay.portal.service.persistence.ResourcePermissionPersistence.impl")
788     protected com.liferay.portal.service.persistence.ResourcePermissionPersistence resourcePermissionPersistence;
789     @BeanReference(name = "com.liferay.portal.service.persistence.RolePersistence.impl")
790     protected com.liferay.portal.service.persistence.RolePersistence rolePersistence;
791     @BeanReference(name = "com.liferay.portal.service.persistence.ServiceComponentPersistence.impl")
792     protected com.liferay.portal.service.persistence.ServiceComponentPersistence serviceComponentPersistence;
793     @BeanReference(name = "com.liferay.portal.service.persistence.ShardPersistence.impl")
794     protected com.liferay.portal.service.persistence.ShardPersistence shardPersistence;
795     @BeanReference(name = "com.liferay.portal.service.persistence.SubscriptionPersistence.impl")
796     protected com.liferay.portal.service.persistence.SubscriptionPersistence subscriptionPersistence;
797     @BeanReference(name = "com.liferay.portal.service.persistence.UserPersistence.impl")
798     protected com.liferay.portal.service.persistence.UserPersistence userPersistence;
799     @BeanReference(name = "com.liferay.portal.service.persistence.UserGroupPersistence.impl")
800     protected com.liferay.portal.service.persistence.UserGroupPersistence userGroupPersistence;
801     @BeanReference(name = "com.liferay.portal.service.persistence.UserGroupRolePersistence.impl")
802     protected com.liferay.portal.service.persistence.UserGroupRolePersistence userGroupRolePersistence;
803     @BeanReference(name = "com.liferay.portal.service.persistence.UserIdMapperPersistence.impl")
804     protected com.liferay.portal.service.persistence.UserIdMapperPersistence userIdMapperPersistence;
805     @BeanReference(name = "com.liferay.portal.service.persistence.UserTrackerPersistence.impl")
806     protected com.liferay.portal.service.persistence.UserTrackerPersistence userTrackerPersistence;
807     @BeanReference(name = "com.liferay.portal.service.persistence.UserTrackerPathPersistence.impl")
808     protected com.liferay.portal.service.persistence.UserTrackerPathPersistence userTrackerPathPersistence;
809     @BeanReference(name = "com.liferay.portal.service.persistence.WebDAVPropsPersistence.impl")
810     protected com.liferay.portal.service.persistence.WebDAVPropsPersistence webDAVPropsPersistence;
811     @BeanReference(name = "com.liferay.portal.service.persistence.WebsitePersistence.impl")
812     protected com.liferay.portal.service.persistence.WebsitePersistence websitePersistence;
813     private static Log _log = LogFactoryUtil.getLog(WebDAVPropsPersistenceImpl.class);
814 }