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