1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    *
5    *
6    *
7    * The contents of this file are subject to the terms of the Liferay Enterprise
8    * Subscription License ("License"). You may not use this file except in
9    * compliance with the License. You can obtain a copy of the License by
10   * contacting Liferay, Inc. See the License for the specific language governing
11   * permissions and limitations under the License, including but not limited to
12   * distribution rights 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.NoSuchResourceCodeException;
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.kernel.util.Validator;
44  import com.liferay.portal.model.ModelListener;
45  import com.liferay.portal.model.ResourceCode;
46  import com.liferay.portal.model.impl.ResourceCodeImpl;
47  import com.liferay.portal.model.impl.ResourceCodeModelImpl;
48  import com.liferay.portal.service.persistence.impl.BasePersistenceImpl;
49  
50  import java.util.ArrayList;
51  import java.util.Collections;
52  import java.util.List;
53  
54  /**
55   * <a href="ResourceCodePersistenceImpl.java.html"><b><i>View Source</i></b></a>
56   *
57   * <p>
58   * ServiceBuilder generated this class. Modifications in this class will be
59   * overwritten the next time is generated.
60   * </p>
61   *
62   * @author    Brian Wing Shun Chan
63   * @see       ResourceCodePersistence
64   * @see       ResourceCodeUtil
65   * @generated
66   */
67  public class ResourceCodePersistenceImpl extends BasePersistenceImpl
68      implements ResourceCodePersistence {
69      public static final String FINDER_CLASS_NAME_ENTITY = ResourceCodeImpl.class.getName();
70      public static final String FINDER_CLASS_NAME_LIST = FINDER_CLASS_NAME_ENTITY +
71          ".List";
72      public static final FinderPath FINDER_PATH_FIND_BY_COMPANYID = new FinderPath(ResourceCodeModelImpl.ENTITY_CACHE_ENABLED,
73              ResourceCodeModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
74              "findByCompanyId", new String[] { Long.class.getName() });
75      public static final FinderPath FINDER_PATH_FIND_BY_OBC_COMPANYID = new FinderPath(ResourceCodeModelImpl.ENTITY_CACHE_ENABLED,
76              ResourceCodeModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
77              "findByCompanyId",
78              new String[] {
79                  Long.class.getName(),
80                  
81              "java.lang.Integer", "java.lang.Integer",
82                  "com.liferay.portal.kernel.util.OrderByComparator"
83              });
84      public static final FinderPath FINDER_PATH_COUNT_BY_COMPANYID = new FinderPath(ResourceCodeModelImpl.ENTITY_CACHE_ENABLED,
85              ResourceCodeModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
86              "countByCompanyId", new String[] { Long.class.getName() });
87      public static final FinderPath FINDER_PATH_FIND_BY_NAME = new FinderPath(ResourceCodeModelImpl.ENTITY_CACHE_ENABLED,
88              ResourceCodeModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
89              "findByName", new String[] { String.class.getName() });
90      public static final FinderPath FINDER_PATH_FIND_BY_OBC_NAME = new FinderPath(ResourceCodeModelImpl.ENTITY_CACHE_ENABLED,
91              ResourceCodeModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
92              "findByName",
93              new String[] {
94                  String.class.getName(),
95                  
96              "java.lang.Integer", "java.lang.Integer",
97                  "com.liferay.portal.kernel.util.OrderByComparator"
98              });
99      public static final FinderPath FINDER_PATH_COUNT_BY_NAME = new FinderPath(ResourceCodeModelImpl.ENTITY_CACHE_ENABLED,
100             ResourceCodeModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
101             "countByName", new String[] { String.class.getName() });
102     public static final FinderPath FINDER_PATH_FETCH_BY_C_N_S = new FinderPath(ResourceCodeModelImpl.ENTITY_CACHE_ENABLED,
103             ResourceCodeModelImpl.FINDER_CACHE_ENABLED,
104             FINDER_CLASS_NAME_ENTITY, "fetchByC_N_S",
105             new String[] {
106                 Long.class.getName(), String.class.getName(),
107                 Integer.class.getName()
108             });
109     public static final FinderPath FINDER_PATH_COUNT_BY_C_N_S = new FinderPath(ResourceCodeModelImpl.ENTITY_CACHE_ENABLED,
110             ResourceCodeModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
111             "countByC_N_S",
112             new String[] {
113                 Long.class.getName(), String.class.getName(),
114                 Integer.class.getName()
115             });
116     public static final FinderPath FINDER_PATH_FIND_ALL = new FinderPath(ResourceCodeModelImpl.ENTITY_CACHE_ENABLED,
117             ResourceCodeModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
118             "findAll", new String[0]);
119     public static final FinderPath FINDER_PATH_COUNT_ALL = new FinderPath(ResourceCodeModelImpl.ENTITY_CACHE_ENABLED,
120             ResourceCodeModelImpl.FINDER_CACHE_ENABLED, FINDER_CLASS_NAME_LIST,
121             "countAll", new String[0]);
122 
123     public void cacheResult(ResourceCode resourceCode) {
124         EntityCacheUtil.putResult(ResourceCodeModelImpl.ENTITY_CACHE_ENABLED,
125             ResourceCodeImpl.class, resourceCode.getPrimaryKey(), resourceCode);
126 
127         FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_C_N_S,
128             new Object[] {
129                 new Long(resourceCode.getCompanyId()),
130                 
131             resourceCode.getName(), new Integer(resourceCode.getScope())
132             }, resourceCode);
133     }
134 
135     public void cacheResult(List<ResourceCode> resourceCodes) {
136         for (ResourceCode resourceCode : resourceCodes) {
137             if (EntityCacheUtil.getResult(
138                         ResourceCodeModelImpl.ENTITY_CACHE_ENABLED,
139                         ResourceCodeImpl.class, resourceCode.getPrimaryKey(),
140                         this) == null) {
141                 cacheResult(resourceCode);
142             }
143         }
144     }
145 
146     public void clearCache() {
147         CacheRegistry.clear(ResourceCodeImpl.class.getName());
148         EntityCacheUtil.clearCache(ResourceCodeImpl.class.getName());
149         FinderCacheUtil.clearCache(FINDER_CLASS_NAME_ENTITY);
150         FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST);
151     }
152 
153     public ResourceCode create(long codeId) {
154         ResourceCode resourceCode = new ResourceCodeImpl();
155 
156         resourceCode.setNew(true);
157         resourceCode.setPrimaryKey(codeId);
158 
159         return resourceCode;
160     }
161 
162     public ResourceCode remove(long codeId)
163         throws NoSuchResourceCodeException, SystemException {
164         Session session = null;
165 
166         try {
167             session = openSession();
168 
169             ResourceCode resourceCode = (ResourceCode)session.get(ResourceCodeImpl.class,
170                     new Long(codeId));
171 
172             if (resourceCode == null) {
173                 if (_log.isWarnEnabled()) {
174                     _log.warn("No ResourceCode exists with the primary key " +
175                         codeId);
176                 }
177 
178                 throw new NoSuchResourceCodeException(
179                     "No ResourceCode exists with the primary key " + codeId);
180             }
181 
182             return remove(resourceCode);
183         }
184         catch (NoSuchResourceCodeException nsee) {
185             throw nsee;
186         }
187         catch (Exception e) {
188             throw processException(e);
189         }
190         finally {
191             closeSession(session);
192         }
193     }
194 
195     public ResourceCode remove(ResourceCode resourceCode)
196         throws SystemException {
197         for (ModelListener<ResourceCode> listener : listeners) {
198             listener.onBeforeRemove(resourceCode);
199         }
200 
201         resourceCode = removeImpl(resourceCode);
202 
203         for (ModelListener<ResourceCode> listener : listeners) {
204             listener.onAfterRemove(resourceCode);
205         }
206 
207         return resourceCode;
208     }
209 
210     protected ResourceCode removeImpl(ResourceCode resourceCode)
211         throws SystemException {
212         Session session = null;
213 
214         try {
215             session = openSession();
216 
217             if (resourceCode.isCachedModel() || BatchSessionUtil.isEnabled()) {
218                 Object staleObject = session.get(ResourceCodeImpl.class,
219                         resourceCode.getPrimaryKeyObj());
220 
221                 if (staleObject != null) {
222                     session.evict(staleObject);
223                 }
224             }
225 
226             session.delete(resourceCode);
227 
228             session.flush();
229         }
230         catch (Exception e) {
231             throw processException(e);
232         }
233         finally {
234             closeSession(session);
235         }
236 
237         FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST);
238 
239         ResourceCodeModelImpl resourceCodeModelImpl = (ResourceCodeModelImpl)resourceCode;
240 
241         FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_C_N_S,
242             new Object[] {
243                 new Long(resourceCodeModelImpl.getOriginalCompanyId()),
244                 
245             resourceCodeModelImpl.getOriginalName(),
246                 new Integer(resourceCodeModelImpl.getOriginalScope())
247             });
248 
249         EntityCacheUtil.removeResult(ResourceCodeModelImpl.ENTITY_CACHE_ENABLED,
250             ResourceCodeImpl.class, resourceCode.getPrimaryKey());
251 
252         return resourceCode;
253     }
254 
255     /**
256      * @deprecated Use {@link #update(ResourceCode, boolean merge)}.
257      */
258     public ResourceCode update(ResourceCode resourceCode)
259         throws SystemException {
260         if (_log.isWarnEnabled()) {
261             _log.warn(
262                 "Using the deprecated update(ResourceCode resourceCode) method. Use update(ResourceCode resourceCode, boolean merge) instead.");
263         }
264 
265         return update(resourceCode, false);
266     }
267 
268     /**
269      * Add, update, or merge, the entity. This method also calls the model
270      * listeners to trigger the proper events associated with adding, deleting,
271      * or updating an entity.
272      *
273      * @param  resourceCode the entity to add, update, or merge
274      * @param  merge boolean value for whether to merge the entity. The default
275      *         value is false. Setting merge to true is more expensive and
276      *         should only be true when resourceCode is transient. See
277      *         LEP-5473 for a detailed discussion of this method.
278      * @return the entity that was added, updated, or merged
279      */
280     public ResourceCode update(ResourceCode resourceCode, boolean merge)
281         throws SystemException {
282         boolean isNew = resourceCode.isNew();
283 
284         for (ModelListener<ResourceCode> listener : listeners) {
285             if (isNew) {
286                 listener.onBeforeCreate(resourceCode);
287             }
288             else {
289                 listener.onBeforeUpdate(resourceCode);
290             }
291         }
292 
293         resourceCode = updateImpl(resourceCode, merge);
294 
295         for (ModelListener<ResourceCode> listener : listeners) {
296             if (isNew) {
297                 listener.onAfterCreate(resourceCode);
298             }
299             else {
300                 listener.onAfterUpdate(resourceCode);
301             }
302         }
303 
304         return resourceCode;
305     }
306 
307     public ResourceCode updateImpl(
308         com.liferay.portal.model.ResourceCode resourceCode, boolean merge)
309         throws SystemException {
310         boolean isNew = resourceCode.isNew();
311 
312         ResourceCodeModelImpl resourceCodeModelImpl = (ResourceCodeModelImpl)resourceCode;
313 
314         Session session = null;
315 
316         try {
317             session = openSession();
318 
319             BatchSessionUtil.update(session, resourceCode, merge);
320 
321             resourceCode.setNew(false);
322         }
323         catch (Exception e) {
324             throw processException(e);
325         }
326         finally {
327             closeSession(session);
328         }
329 
330         FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST);
331 
332         EntityCacheUtil.putResult(ResourceCodeModelImpl.ENTITY_CACHE_ENABLED,
333             ResourceCodeImpl.class, resourceCode.getPrimaryKey(), resourceCode);
334 
335         if (!isNew &&
336                 ((resourceCode.getCompanyId() != resourceCodeModelImpl.getOriginalCompanyId()) ||
337                 !Validator.equals(resourceCode.getName(),
338                     resourceCodeModelImpl.getOriginalName()) ||
339                 (resourceCode.getScope() != resourceCodeModelImpl.getOriginalScope()))) {
340             FinderCacheUtil.removeResult(FINDER_PATH_FETCH_BY_C_N_S,
341                 new Object[] {
342                     new Long(resourceCodeModelImpl.getOriginalCompanyId()),
343                     
344                 resourceCodeModelImpl.getOriginalName(),
345                     new Integer(resourceCodeModelImpl.getOriginalScope())
346                 });
347         }
348 
349         if (isNew ||
350                 ((resourceCode.getCompanyId() != resourceCodeModelImpl.getOriginalCompanyId()) ||
351                 !Validator.equals(resourceCode.getName(),
352                     resourceCodeModelImpl.getOriginalName()) ||
353                 (resourceCode.getScope() != resourceCodeModelImpl.getOriginalScope()))) {
354             FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_C_N_S,
355                 new Object[] {
356                     new Long(resourceCode.getCompanyId()),
357                     
358                 resourceCode.getName(), new Integer(resourceCode.getScope())
359                 }, resourceCode);
360         }
361 
362         return resourceCode;
363     }
364 
365     public ResourceCode findByPrimaryKey(long codeId)
366         throws NoSuchResourceCodeException, SystemException {
367         ResourceCode resourceCode = fetchByPrimaryKey(codeId);
368 
369         if (resourceCode == null) {
370             if (_log.isWarnEnabled()) {
371                 _log.warn("No ResourceCode exists with the primary key " +
372                     codeId);
373             }
374 
375             throw new NoSuchResourceCodeException(
376                 "No ResourceCode exists with the primary key " + codeId);
377         }
378 
379         return resourceCode;
380     }
381 
382     public ResourceCode fetchByPrimaryKey(long codeId)
383         throws SystemException {
384         ResourceCode resourceCode = (ResourceCode)EntityCacheUtil.getResult(ResourceCodeModelImpl.ENTITY_CACHE_ENABLED,
385                 ResourceCodeImpl.class, codeId, this);
386 
387         if (resourceCode == null) {
388             Session session = null;
389 
390             try {
391                 session = openSession();
392 
393                 resourceCode = (ResourceCode)session.get(ResourceCodeImpl.class,
394                         new Long(codeId));
395             }
396             catch (Exception e) {
397                 throw processException(e);
398             }
399             finally {
400                 if (resourceCode != null) {
401                     cacheResult(resourceCode);
402                 }
403 
404                 closeSession(session);
405             }
406         }
407 
408         return resourceCode;
409     }
410 
411     public List<ResourceCode> findByCompanyId(long companyId)
412         throws SystemException {
413         Object[] finderArgs = new Object[] { new Long(companyId) };
414 
415         List<ResourceCode> list = (List<ResourceCode>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_COMPANYID,
416                 finderArgs, this);
417 
418         if (list == null) {
419             Session session = null;
420 
421             try {
422                 session = openSession();
423 
424                 StringBuilder query = new StringBuilder();
425 
426                 query.append(
427                     "SELECT resourceCode FROM ResourceCode resourceCode WHERE ");
428 
429                 query.append("resourceCode.companyId = ?");
430 
431                 query.append(" ");
432 
433                 Query q = session.createQuery(query.toString());
434 
435                 QueryPos qPos = QueryPos.getInstance(q);
436 
437                 qPos.add(companyId);
438 
439                 list = q.list();
440             }
441             catch (Exception e) {
442                 throw processException(e);
443             }
444             finally {
445                 if (list == null) {
446                     list = new ArrayList<ResourceCode>();
447                 }
448 
449                 cacheResult(list);
450 
451                 FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_COMPANYID,
452                     finderArgs, list);
453 
454                 closeSession(session);
455             }
456         }
457 
458         return list;
459     }
460 
461     public List<ResourceCode> findByCompanyId(long companyId, int start, int end)
462         throws SystemException {
463         return findByCompanyId(companyId, start, end, null);
464     }
465 
466     public List<ResourceCode> findByCompanyId(long companyId, int start,
467         int end, OrderByComparator obc) throws SystemException {
468         Object[] finderArgs = new Object[] {
469                 new Long(companyId),
470                 
471                 String.valueOf(start), String.valueOf(end), String.valueOf(obc)
472             };
473 
474         List<ResourceCode> list = (List<ResourceCode>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_OBC_COMPANYID,
475                 finderArgs, this);
476 
477         if (list == null) {
478             Session session = null;
479 
480             try {
481                 session = openSession();
482 
483                 StringBuilder query = new StringBuilder();
484 
485                 query.append(
486                     "SELECT resourceCode FROM ResourceCode resourceCode WHERE ");
487 
488                 query.append("resourceCode.companyId = ?");
489 
490                 query.append(" ");
491 
492                 if (obc != null) {
493                     query.append("ORDER BY ");
494 
495                     String[] orderByFields = obc.getOrderByFields();
496 
497                     for (int i = 0; i < orderByFields.length; i++) {
498                         query.append("resourceCode.");
499                         query.append(orderByFields[i]);
500 
501                         if (obc.isAscending()) {
502                             query.append(" ASC");
503                         }
504                         else {
505                             query.append(" DESC");
506                         }
507 
508                         if ((i + 1) < orderByFields.length) {
509                             query.append(", ");
510                         }
511                     }
512                 }
513 
514                 Query q = session.createQuery(query.toString());
515 
516                 QueryPos qPos = QueryPos.getInstance(q);
517 
518                 qPos.add(companyId);
519 
520                 list = (List<ResourceCode>)QueryUtil.list(q, getDialect(),
521                         start, end);
522             }
523             catch (Exception e) {
524                 throw processException(e);
525             }
526             finally {
527                 if (list == null) {
528                     list = new ArrayList<ResourceCode>();
529                 }
530 
531                 cacheResult(list);
532 
533                 FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_OBC_COMPANYID,
534                     finderArgs, list);
535 
536                 closeSession(session);
537             }
538         }
539 
540         return list;
541     }
542 
543     public ResourceCode findByCompanyId_First(long companyId,
544         OrderByComparator obc)
545         throws NoSuchResourceCodeException, SystemException {
546         List<ResourceCode> list = findByCompanyId(companyId, 0, 1, obc);
547 
548         if (list.isEmpty()) {
549             StringBuilder msg = new StringBuilder();
550 
551             msg.append("No ResourceCode exists with the key {");
552 
553             msg.append("companyId=" + companyId);
554 
555             msg.append(StringPool.CLOSE_CURLY_BRACE);
556 
557             throw new NoSuchResourceCodeException(msg.toString());
558         }
559         else {
560             return list.get(0);
561         }
562     }
563 
564     public ResourceCode findByCompanyId_Last(long companyId,
565         OrderByComparator obc)
566         throws NoSuchResourceCodeException, SystemException {
567         int count = countByCompanyId(companyId);
568 
569         List<ResourceCode> list = findByCompanyId(companyId, count - 1, count,
570                 obc);
571 
572         if (list.isEmpty()) {
573             StringBuilder msg = new StringBuilder();
574 
575             msg.append("No ResourceCode exists with the key {");
576 
577             msg.append("companyId=" + companyId);
578 
579             msg.append(StringPool.CLOSE_CURLY_BRACE);
580 
581             throw new NoSuchResourceCodeException(msg.toString());
582         }
583         else {
584             return list.get(0);
585         }
586     }
587 
588     public ResourceCode[] findByCompanyId_PrevAndNext(long codeId,
589         long companyId, OrderByComparator obc)
590         throws NoSuchResourceCodeException, SystemException {
591         ResourceCode resourceCode = findByPrimaryKey(codeId);
592 
593         int count = countByCompanyId(companyId);
594 
595         Session session = null;
596 
597         try {
598             session = openSession();
599 
600             StringBuilder query = new StringBuilder();
601 
602             query.append(
603                 "SELECT resourceCode FROM ResourceCode resourceCode WHERE ");
604 
605             query.append("resourceCode.companyId = ?");
606 
607             query.append(" ");
608 
609             if (obc != null) {
610                 query.append("ORDER BY ");
611 
612                 String[] orderByFields = obc.getOrderByFields();
613 
614                 for (int i = 0; i < orderByFields.length; i++) {
615                     query.append("resourceCode.");
616                     query.append(orderByFields[i]);
617 
618                     if (obc.isAscending()) {
619                         query.append(" ASC");
620                     }
621                     else {
622                         query.append(" DESC");
623                     }
624 
625                     if ((i + 1) < orderByFields.length) {
626                         query.append(", ");
627                     }
628                 }
629             }
630 
631             Query q = session.createQuery(query.toString());
632 
633             QueryPos qPos = QueryPos.getInstance(q);
634 
635             qPos.add(companyId);
636 
637             Object[] objArray = QueryUtil.getPrevAndNext(q, count, obc,
638                     resourceCode);
639 
640             ResourceCode[] array = new ResourceCodeImpl[3];
641 
642             array[0] = (ResourceCode)objArray[0];
643             array[1] = (ResourceCode)objArray[1];
644             array[2] = (ResourceCode)objArray[2];
645 
646             return array;
647         }
648         catch (Exception e) {
649             throw processException(e);
650         }
651         finally {
652             closeSession(session);
653         }
654     }
655 
656     public List<ResourceCode> findByName(String name) throws SystemException {
657         Object[] finderArgs = new Object[] { name };
658 
659         List<ResourceCode> list = (List<ResourceCode>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_NAME,
660                 finderArgs, this);
661 
662         if (list == null) {
663             Session session = null;
664 
665             try {
666                 session = openSession();
667 
668                 StringBuilder query = new StringBuilder();
669 
670                 query.append(
671                     "SELECT resourceCode FROM ResourceCode resourceCode WHERE ");
672 
673                 if (name == null) {
674                     query.append("resourceCode.name IS NULL");
675                 }
676                 else {
677                     query.append("resourceCode.name = ?");
678                 }
679 
680                 query.append(" ");
681 
682                 Query q = session.createQuery(query.toString());
683 
684                 QueryPos qPos = QueryPos.getInstance(q);
685 
686                 if (name != null) {
687                     qPos.add(name);
688                 }
689 
690                 list = q.list();
691             }
692             catch (Exception e) {
693                 throw processException(e);
694             }
695             finally {
696                 if (list == null) {
697                     list = new ArrayList<ResourceCode>();
698                 }
699 
700                 cacheResult(list);
701 
702                 FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_NAME, finderArgs,
703                     list);
704 
705                 closeSession(session);
706             }
707         }
708 
709         return list;
710     }
711 
712     public List<ResourceCode> findByName(String name, int start, int end)
713         throws SystemException {
714         return findByName(name, start, end, null);
715     }
716 
717     public List<ResourceCode> findByName(String name, int start, int end,
718         OrderByComparator obc) throws SystemException {
719         Object[] finderArgs = new Object[] {
720                 name,
721                 
722                 String.valueOf(start), String.valueOf(end), String.valueOf(obc)
723             };
724 
725         List<ResourceCode> list = (List<ResourceCode>)FinderCacheUtil.getResult(FINDER_PATH_FIND_BY_OBC_NAME,
726                 finderArgs, this);
727 
728         if (list == null) {
729             Session session = null;
730 
731             try {
732                 session = openSession();
733 
734                 StringBuilder query = new StringBuilder();
735 
736                 query.append(
737                     "SELECT resourceCode FROM ResourceCode resourceCode WHERE ");
738 
739                 if (name == null) {
740                     query.append("resourceCode.name IS NULL");
741                 }
742                 else {
743                     query.append("resourceCode.name = ?");
744                 }
745 
746                 query.append(" ");
747 
748                 if (obc != null) {
749                     query.append("ORDER BY ");
750 
751                     String[] orderByFields = obc.getOrderByFields();
752 
753                     for (int i = 0; i < orderByFields.length; i++) {
754                         query.append("resourceCode.");
755                         query.append(orderByFields[i]);
756 
757                         if (obc.isAscending()) {
758                             query.append(" ASC");
759                         }
760                         else {
761                             query.append(" DESC");
762                         }
763 
764                         if ((i + 1) < orderByFields.length) {
765                             query.append(", ");
766                         }
767                     }
768                 }
769 
770                 Query q = session.createQuery(query.toString());
771 
772                 QueryPos qPos = QueryPos.getInstance(q);
773 
774                 if (name != null) {
775                     qPos.add(name);
776                 }
777 
778                 list = (List<ResourceCode>)QueryUtil.list(q, getDialect(),
779                         start, end);
780             }
781             catch (Exception e) {
782                 throw processException(e);
783             }
784             finally {
785                 if (list == null) {
786                     list = new ArrayList<ResourceCode>();
787                 }
788 
789                 cacheResult(list);
790 
791                 FinderCacheUtil.putResult(FINDER_PATH_FIND_BY_OBC_NAME,
792                     finderArgs, list);
793 
794                 closeSession(session);
795             }
796         }
797 
798         return list;
799     }
800 
801     public ResourceCode findByName_First(String name, OrderByComparator obc)
802         throws NoSuchResourceCodeException, SystemException {
803         List<ResourceCode> list = findByName(name, 0, 1, obc);
804 
805         if (list.isEmpty()) {
806             StringBuilder msg = new StringBuilder();
807 
808             msg.append("No ResourceCode exists with the key {");
809 
810             msg.append("name=" + name);
811 
812             msg.append(StringPool.CLOSE_CURLY_BRACE);
813 
814             throw new NoSuchResourceCodeException(msg.toString());
815         }
816         else {
817             return list.get(0);
818         }
819     }
820 
821     public ResourceCode findByName_Last(String name, OrderByComparator obc)
822         throws NoSuchResourceCodeException, SystemException {
823         int count = countByName(name);
824 
825         List<ResourceCode> list = findByName(name, count - 1, count, obc);
826 
827         if (list.isEmpty()) {
828             StringBuilder msg = new StringBuilder();
829 
830             msg.append("No ResourceCode exists with the key {");
831 
832             msg.append("name=" + name);
833 
834             msg.append(StringPool.CLOSE_CURLY_BRACE);
835 
836             throw new NoSuchResourceCodeException(msg.toString());
837         }
838         else {
839             return list.get(0);
840         }
841     }
842 
843     public ResourceCode[] findByName_PrevAndNext(long codeId, String name,
844         OrderByComparator obc)
845         throws NoSuchResourceCodeException, SystemException {
846         ResourceCode resourceCode = findByPrimaryKey(codeId);
847 
848         int count = countByName(name);
849 
850         Session session = null;
851 
852         try {
853             session = openSession();
854 
855             StringBuilder query = new StringBuilder();
856 
857             query.append(
858                 "SELECT resourceCode FROM ResourceCode resourceCode WHERE ");
859 
860             if (name == null) {
861                 query.append("resourceCode.name IS NULL");
862             }
863             else {
864                 query.append("resourceCode.name = ?");
865             }
866 
867             query.append(" ");
868 
869             if (obc != null) {
870                 query.append("ORDER BY ");
871 
872                 String[] orderByFields = obc.getOrderByFields();
873 
874                 for (int i = 0; i < orderByFields.length; i++) {
875                     query.append("resourceCode.");
876                     query.append(orderByFields[i]);
877 
878                     if (obc.isAscending()) {
879                         query.append(" ASC");
880                     }
881                     else {
882                         query.append(" DESC");
883                     }
884 
885                     if ((i + 1) < orderByFields.length) {
886                         query.append(", ");
887                     }
888                 }
889             }
890 
891             Query q = session.createQuery(query.toString());
892 
893             QueryPos qPos = QueryPos.getInstance(q);
894 
895             if (name != null) {
896                 qPos.add(name);
897             }
898 
899             Object[] objArray = QueryUtil.getPrevAndNext(q, count, obc,
900                     resourceCode);
901 
902             ResourceCode[] array = new ResourceCodeImpl[3];
903 
904             array[0] = (ResourceCode)objArray[0];
905             array[1] = (ResourceCode)objArray[1];
906             array[2] = (ResourceCode)objArray[2];
907 
908             return array;
909         }
910         catch (Exception e) {
911             throw processException(e);
912         }
913         finally {
914             closeSession(session);
915         }
916     }
917 
918     public ResourceCode findByC_N_S(long companyId, String name, int scope)
919         throws NoSuchResourceCodeException, SystemException {
920         ResourceCode resourceCode = fetchByC_N_S(companyId, name, scope);
921 
922         if (resourceCode == null) {
923             StringBuilder msg = new StringBuilder();
924 
925             msg.append("No ResourceCode exists with the key {");
926 
927             msg.append("companyId=" + companyId);
928 
929             msg.append(", ");
930             msg.append("name=" + name);
931 
932             msg.append(", ");
933             msg.append("scope=" + scope);
934 
935             msg.append(StringPool.CLOSE_CURLY_BRACE);
936 
937             if (_log.isWarnEnabled()) {
938                 _log.warn(msg.toString());
939             }
940 
941             throw new NoSuchResourceCodeException(msg.toString());
942         }
943 
944         return resourceCode;
945     }
946 
947     public ResourceCode fetchByC_N_S(long companyId, String name, int scope)
948         throws SystemException {
949         return fetchByC_N_S(companyId, name, scope, true);
950     }
951 
952     public ResourceCode fetchByC_N_S(long companyId, String name, int scope,
953         boolean retrieveFromCache) throws SystemException {
954         Object[] finderArgs = new Object[] {
955                 new Long(companyId),
956                 
957                 name, new Integer(scope)
958             };
959 
960         Object result = null;
961 
962         if (retrieveFromCache) {
963             result = FinderCacheUtil.getResult(FINDER_PATH_FETCH_BY_C_N_S,
964                     finderArgs, this);
965         }
966 
967         if (result == null) {
968             Session session = null;
969 
970             try {
971                 session = openSession();
972 
973                 StringBuilder query = new StringBuilder();
974 
975                 query.append(
976                     "SELECT resourceCode FROM ResourceCode resourceCode WHERE ");
977 
978                 query.append("resourceCode.companyId = ?");
979 
980                 query.append(" AND ");
981 
982                 if (name == null) {
983                     query.append("resourceCode.name IS NULL");
984                 }
985                 else {
986                     query.append("resourceCode.name = ?");
987                 }
988 
989                 query.append(" AND ");
990 
991                 query.append("resourceCode.scope = ?");
992 
993                 query.append(" ");
994 
995                 Query q = session.createQuery(query.toString());
996 
997                 QueryPos qPos = QueryPos.getInstance(q);
998 
999                 qPos.add(companyId);
1000
1001                if (name != null) {
1002                    qPos.add(name);
1003                }
1004
1005                qPos.add(scope);
1006
1007                List<ResourceCode> list = q.list();
1008
1009                result = list;
1010
1011                ResourceCode resourceCode = null;
1012
1013                if (list.isEmpty()) {
1014                    FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_C_N_S,
1015                        finderArgs, list);
1016                }
1017                else {
1018                    resourceCode = list.get(0);
1019
1020                    cacheResult(resourceCode);
1021
1022                    if ((resourceCode.getCompanyId() != companyId) ||
1023                            (resourceCode.getName() == null) ||
1024                            !resourceCode.getName().equals(name) ||
1025                            (resourceCode.getScope() != scope)) {
1026                        FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_C_N_S,
1027                            finderArgs, resourceCode);
1028                    }
1029                }
1030
1031                return resourceCode;
1032            }
1033            catch (Exception e) {
1034                throw processException(e);
1035            }
1036            finally {
1037                if (result == null) {
1038                    FinderCacheUtil.putResult(FINDER_PATH_FETCH_BY_C_N_S,
1039                        finderArgs, new ArrayList<ResourceCode>());
1040                }
1041
1042                closeSession(session);
1043            }
1044        }
1045        else {
1046            if (result instanceof List<?>) {
1047                return null;
1048            }
1049            else {
1050                return (ResourceCode)result;
1051            }
1052        }
1053    }
1054
1055    public List<Object> findWithDynamicQuery(DynamicQuery dynamicQuery)
1056        throws SystemException {
1057        Session session = null;
1058
1059        try {
1060            session = openSession();
1061
1062            dynamicQuery.compile(session);
1063
1064            return dynamicQuery.list();
1065        }
1066        catch (Exception e) {
1067            throw processException(e);
1068        }
1069        finally {
1070            closeSession(session);
1071        }
1072    }
1073
1074    public List<Object> findWithDynamicQuery(DynamicQuery dynamicQuery,
1075        int start, int end) throws SystemException {
1076        Session session = null;
1077
1078        try {
1079            session = openSession();
1080
1081            dynamicQuery.setLimit(start, end);
1082
1083            dynamicQuery.compile(session);
1084
1085            return dynamicQuery.list();
1086        }
1087        catch (Exception e) {
1088            throw processException(e);
1089        }
1090        finally {
1091            closeSession(session);
1092        }
1093    }
1094
1095    public List<ResourceCode> findAll() throws SystemException {
1096        return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
1097    }
1098
1099    public List<ResourceCode> findAll(int start, int end)
1100        throws SystemException {
1101        return findAll(start, end, null);
1102    }
1103
1104    public List<ResourceCode> findAll(int start, int end, OrderByComparator obc)
1105        throws SystemException {
1106        Object[] finderArgs = new Object[] {
1107                String.valueOf(start), String.valueOf(end), String.valueOf(obc)
1108            };
1109
1110        List<ResourceCode> list = (List<ResourceCode>)FinderCacheUtil.getResult(FINDER_PATH_FIND_ALL,
1111                finderArgs, this);
1112
1113        if (list == null) {
1114            Session session = null;
1115
1116            try {
1117                session = openSession();
1118
1119                StringBuilder query = new StringBuilder();
1120
1121                query.append(
1122                    "SELECT resourceCode FROM ResourceCode resourceCode ");
1123
1124                if (obc != null) {
1125                    query.append("ORDER BY ");
1126
1127                    String[] orderByFields = obc.getOrderByFields();
1128
1129                    for (int i = 0; i < orderByFields.length; i++) {
1130                        query.append("resourceCode.");
1131                        query.append(orderByFields[i]);
1132
1133                        if (obc.isAscending()) {
1134                            query.append(" ASC");
1135                        }
1136                        else {
1137                            query.append(" DESC");
1138                        }
1139
1140                        if ((i + 1) < orderByFields.length) {
1141                            query.append(", ");
1142                        }
1143                    }
1144                }
1145
1146                Query q = session.createQuery(query.toString());
1147
1148                if (obc == null) {
1149                    list = (List<ResourceCode>)QueryUtil.list(q, getDialect(),
1150                            start, end, false);
1151
1152                    Collections.sort(list);
1153                }
1154                else {
1155                    list = (List<ResourceCode>)QueryUtil.list(q, getDialect(),
1156                            start, end);
1157                }
1158            }
1159            catch (Exception e) {
1160                throw processException(e);
1161            }
1162            finally {
1163                if (list == null) {
1164                    list = new ArrayList<ResourceCode>();
1165                }
1166
1167                cacheResult(list);
1168
1169                FinderCacheUtil.putResult(FINDER_PATH_FIND_ALL, finderArgs, list);
1170
1171                closeSession(session);
1172            }
1173        }
1174
1175        return list;
1176    }
1177
1178    public void removeByCompanyId(long companyId) throws SystemException {
1179        for (ResourceCode resourceCode : findByCompanyId(companyId)) {
1180            remove(resourceCode);
1181        }
1182    }
1183
1184    public void removeByName(String name) throws SystemException {
1185        for (ResourceCode resourceCode : findByName(name)) {
1186            remove(resourceCode);
1187        }
1188    }
1189
1190    public void removeByC_N_S(long companyId, String name, int scope)
1191        throws NoSuchResourceCodeException, SystemException {
1192        ResourceCode resourceCode = findByC_N_S(companyId, name, scope);
1193
1194        remove(resourceCode);
1195    }
1196
1197    public void removeAll() throws SystemException {
1198        for (ResourceCode resourceCode : findAll()) {
1199            remove(resourceCode);
1200        }
1201    }
1202
1203    public int countByCompanyId(long companyId) throws SystemException {
1204        Object[] finderArgs = new Object[] { new Long(companyId) };
1205
1206        Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_COMPANYID,
1207                finderArgs, this);
1208
1209        if (count == null) {
1210            Session session = null;
1211
1212            try {
1213                session = openSession();
1214
1215                StringBuilder query = new StringBuilder();
1216
1217                query.append("SELECT COUNT(resourceCode) ");
1218                query.append("FROM ResourceCode resourceCode WHERE ");
1219
1220                query.append("resourceCode.companyId = ?");
1221
1222                query.append(" ");
1223
1224                Query q = session.createQuery(query.toString());
1225
1226                QueryPos qPos = QueryPos.getInstance(q);
1227
1228                qPos.add(companyId);
1229
1230                count = (Long)q.uniqueResult();
1231            }
1232            catch (Exception e) {
1233                throw processException(e);
1234            }
1235            finally {
1236                if (count == null) {
1237                    count = Long.valueOf(0);
1238                }
1239
1240                FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_COMPANYID,
1241                    finderArgs, count);
1242
1243                closeSession(session);
1244            }
1245        }
1246
1247        return count.intValue();
1248    }
1249
1250    public int countByName(String name) throws SystemException {
1251        Object[] finderArgs = new Object[] { name };
1252
1253        Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_NAME,
1254                finderArgs, this);
1255
1256        if (count == null) {
1257            Session session = null;
1258
1259            try {
1260                session = openSession();
1261
1262                StringBuilder query = new StringBuilder();
1263
1264                query.append("SELECT COUNT(resourceCode) ");
1265                query.append("FROM ResourceCode resourceCode WHERE ");
1266
1267                if (name == null) {
1268                    query.append("resourceCode.name IS NULL");
1269                }
1270                else {
1271                    query.append("resourceCode.name = ?");
1272                }
1273
1274                query.append(" ");
1275
1276                Query q = session.createQuery(query.toString());
1277
1278                QueryPos qPos = QueryPos.getInstance(q);
1279
1280                if (name != null) {
1281                    qPos.add(name);
1282                }
1283
1284                count = (Long)q.uniqueResult();
1285            }
1286            catch (Exception e) {
1287                throw processException(e);
1288            }
1289            finally {
1290                if (count == null) {
1291                    count = Long.valueOf(0);
1292                }
1293
1294                FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_NAME,
1295                    finderArgs, count);
1296
1297                closeSession(session);
1298            }
1299        }
1300
1301        return count.intValue();
1302    }
1303
1304    public int countByC_N_S(long companyId, String name, int scope)
1305        throws SystemException {
1306        Object[] finderArgs = new Object[] {
1307                new Long(companyId),
1308                
1309                name, new Integer(scope)
1310            };
1311
1312        Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_BY_C_N_S,
1313                finderArgs, this);
1314
1315        if (count == null) {
1316            Session session = null;
1317
1318            try {
1319                session = openSession();
1320
1321                StringBuilder query = new StringBuilder();
1322
1323                query.append("SELECT COUNT(resourceCode) ");
1324                query.append("FROM ResourceCode resourceCode WHERE ");
1325
1326                query.append("resourceCode.companyId = ?");
1327
1328                query.append(" AND ");
1329
1330                if (name == null) {
1331                    query.append("resourceCode.name IS NULL");
1332                }
1333                else {
1334                    query.append("resourceCode.name = ?");
1335                }
1336
1337                query.append(" AND ");
1338
1339                query.append("resourceCode.scope = ?");
1340
1341                query.append(" ");
1342
1343                Query q = session.createQuery(query.toString());
1344
1345                QueryPos qPos = QueryPos.getInstance(q);
1346
1347                qPos.add(companyId);
1348
1349                if (name != null) {
1350                    qPos.add(name);
1351                }
1352
1353                qPos.add(scope);
1354
1355                count = (Long)q.uniqueResult();
1356            }
1357            catch (Exception e) {
1358                throw processException(e);
1359            }
1360            finally {
1361                if (count == null) {
1362                    count = Long.valueOf(0);
1363                }
1364
1365                FinderCacheUtil.putResult(FINDER_PATH_COUNT_BY_C_N_S,
1366                    finderArgs, count);
1367
1368                closeSession(session);
1369            }
1370        }
1371
1372        return count.intValue();
1373    }
1374
1375    public int countAll() throws SystemException {
1376        Object[] finderArgs = new Object[0];
1377
1378        Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_ALL,
1379                finderArgs, this);
1380
1381        if (count == null) {
1382            Session session = null;
1383
1384            try {
1385                session = openSession();
1386
1387                Query q = session.createQuery(
1388                        "SELECT COUNT(resourceCode) FROM ResourceCode resourceCode");
1389
1390                count = (Long)q.uniqueResult();
1391            }
1392            catch (Exception e) {
1393                throw processException(e);
1394            }
1395            finally {
1396                if (count == null) {
1397                    count = Long.valueOf(0);
1398                }
1399
1400                FinderCacheUtil.putResult(FINDER_PATH_COUNT_ALL, finderArgs,
1401                    count);
1402
1403                closeSession(session);
1404            }
1405        }
1406
1407        return count.intValue();
1408    }
1409
1410    public void afterPropertiesSet() {
1411        String[] listenerClassNames = StringUtil.split(GetterUtil.getString(
1412                    com.liferay.portal.util.PropsUtil.get(
1413                        "value.object.listener.com.liferay.portal.model.ResourceCode")));
1414
1415        if (listenerClassNames.length > 0) {
1416            try {
1417                List<ModelListener<ResourceCode>> listenersList = new ArrayList<ModelListener<ResourceCode>>();
1418
1419                for (String listenerClassName : listenerClassNames) {
1420                    listenersList.add((ModelListener<ResourceCode>)Class.forName(
1421                            listenerClassName).newInstance());
1422                }
1423
1424                listeners = listenersList.toArray(new ModelListener[listenersList.size()]);
1425            }
1426            catch (Exception e) {
1427                _log.error(e);
1428            }
1429        }
1430    }
1431
1432    @BeanReference(name = "com.liferay.portal.service.persistence.AccountPersistence.impl")
1433    protected com.liferay.portal.service.persistence.AccountPersistence accountPersistence;
1434    @BeanReference(name = "com.liferay.portal.service.persistence.AddressPersistence.impl")
1435    protected com.liferay.portal.service.persistence.AddressPersistence addressPersistence;
1436    @BeanReference(name = "com.liferay.portal.service.persistence.BrowserTrackerPersistence.impl")
1437    protected com.liferay.portal.service.persistence.BrowserTrackerPersistence browserTrackerPersistence;
1438    @BeanReference(name = "com.liferay.portal.service.persistence.ClassNamePersistence.impl")
1439    protected com.liferay.portal.service.persistence.ClassNamePersistence classNamePersistence;
1440    @BeanReference(name = "com.liferay.portal.service.persistence.CompanyPersistence.impl")
1441    protected com.liferay.portal.service.persistence.CompanyPersistence companyPersistence;
1442    @BeanReference(name = "com.liferay.portal.service.persistence.ContactPersistence.impl")
1443    protected com.liferay.portal.service.persistence.ContactPersistence contactPersistence;
1444    @BeanReference(name = "com.liferay.portal.service.persistence.CountryPersistence.impl")
1445    protected com.liferay.portal.service.persistence.CountryPersistence countryPersistence;
1446    @BeanReference(name = "com.liferay.portal.service.persistence.EmailAddressPersistence.impl")
1447    protected com.liferay.portal.service.persistence.EmailAddressPersistence emailAddressPersistence;
1448    @BeanReference(name = "com.liferay.portal.service.persistence.GroupPersistence.impl")
1449    protected com.liferay.portal.service.persistence.GroupPersistence groupPersistence;
1450    @BeanReference(name = "com.liferay.portal.service.persistence.ImagePersistence.impl")
1451    protected com.liferay.portal.service.persistence.ImagePersistence imagePersistence;
1452    @BeanReference(name = "com.liferay.portal.service.persistence.LayoutPersistence.impl")
1453    protected com.liferay.portal.service.persistence.LayoutPersistence layoutPersistence;
1454    @BeanReference(name = "com.liferay.portal.service.persistence.LayoutSetPersistence.impl")
1455    protected com.liferay.portal.service.persistence.LayoutSetPersistence layoutSetPersistence;
1456    @BeanReference(name = "com.liferay.portal.service.persistence.ListTypePersistence.impl")
1457    protected com.liferay.portal.service.persistence.ListTypePersistence listTypePersistence;
1458    @BeanReference(name = "com.liferay.portal.service.persistence.LockPersistence.impl")
1459    protected com.liferay.portal.service.persistence.LockPersistence lockPersistence;
1460    @BeanReference(name = "com.liferay.portal.service.persistence.MembershipRequestPersistence.impl")
1461    protected com.liferay.portal.service.persistence.MembershipRequestPersistence membershipRequestPersistence;
1462    @BeanReference(name = "com.liferay.portal.service.persistence.OrganizationPersistence.impl")
1463    protected com.liferay.portal.service.persistence.OrganizationPersistence organizationPersistence;
1464    @BeanReference(name = "com.liferay.portal.service.persistence.OrgGroupPermissionPersistence.impl")
1465    protected com.liferay.portal.service.persistence.OrgGroupPermissionPersistence orgGroupPermissionPersistence;
1466    @BeanReference(name = "com.liferay.portal.service.persistence.OrgGroupRolePersistence.impl")
1467    protected com.liferay.portal.service.persistence.OrgGroupRolePersistence orgGroupRolePersistence;
1468    @BeanReference(name = "com.liferay.portal.service.persistence.OrgLaborPersistence.impl")
1469    protected com.liferay.portal.service.persistence.OrgLaborPersistence orgLaborPersistence;
1470    @BeanReference(name = "com.liferay.portal.service.persistence.PasswordPolicyPersistence.impl")
1471    protected com.liferay.portal.service.persistence.PasswordPolicyPersistence passwordPolicyPersistence;
1472    @BeanReference(name = "com.liferay.portal.service.persistence.PasswordPolicyRelPersistence.impl")
1473    protected com.liferay.portal.service.persistence.PasswordPolicyRelPersistence passwordPolicyRelPersistence;
1474    @BeanReference(name = "com.liferay.portal.service.persistence.PasswordTrackerPersistence.impl")
1475    protected com.liferay.portal.service.persistence.PasswordTrackerPersistence passwordTrackerPersistence;
1476    @BeanReference(name = "com.liferay.portal.service.persistence.PermissionPersistence.impl")
1477    protected com.liferay.portal.service.persistence.PermissionPersistence permissionPersistence;
1478    @BeanReference(name = "com.liferay.portal.service.persistence.PhonePersistence.impl")
1479    protected com.liferay.portal.service.persistence.PhonePersistence phonePersistence;
1480    @BeanReference(name = "com.liferay.portal.service.persistence.PluginSettingPersistence.impl")
1481    protected com.liferay.portal.service.persistence.PluginSettingPersistence pluginSettingPersistence;
1482    @BeanReference(name = "com.liferay.portal.service.persistence.PortletPersistence.impl")
1483    protected com.liferay.portal.service.persistence.PortletPersistence portletPersistence;
1484    @BeanReference(name = "com.liferay.portal.service.persistence.PortletItemPersistence.impl")
1485    protected com.liferay.portal.service.persistence.PortletItemPersistence portletItemPersistence;
1486    @BeanReference(name = "com.liferay.portal.service.persistence.PortletPreferencesPersistence.impl")
1487    protected com.liferay.portal.service.persistence.PortletPreferencesPersistence portletPreferencesPersistence;
1488    @BeanReference(name = "com.liferay.portal.service.persistence.RegionPersistence.impl")
1489    protected com.liferay.portal.service.persistence.RegionPersistence regionPersistence;
1490    @BeanReference(name = "com.liferay.portal.service.persistence.ReleasePersistence.impl")
1491    protected com.liferay.portal.service.persistence.ReleasePersistence releasePersistence;
1492    @BeanReference(name = "com.liferay.portal.service.persistence.ResourcePersistence.impl")
1493    protected com.liferay.portal.service.persistence.ResourcePersistence resourcePersistence;
1494    @BeanReference(name = "com.liferay.portal.service.persistence.ResourceActionPersistence.impl")
1495    protected com.liferay.portal.service.persistence.ResourceActionPersistence resourceActionPersistence;
1496    @BeanReference(name = "com.liferay.portal.service.persistence.ResourceCodePersistence.impl")
1497    protected com.liferay.portal.service.persistence.ResourceCodePersistence resourceCodePersistence;
1498    @BeanReference(name = "com.liferay.portal.service.persistence.ResourcePermissionPersistence.impl")
1499    protected com.liferay.portal.service.persistence.ResourcePermissionPersistence resourcePermissionPersistence;
1500    @BeanReference(name = "com.liferay.portal.service.persistence.RolePersistence.impl")
1501    protected com.liferay.portal.service.persistence.RolePersistence rolePersistence;
1502    @BeanReference(name = "com.liferay.portal.service.persistence.ServiceComponentPersistence.impl")
1503    protected com.liferay.portal.service.persistence.ServiceComponentPersistence serviceComponentPersistence;
1504    @BeanReference(name = "com.liferay.portal.service.persistence.ShardPersistence.impl")
1505    protected com.liferay.portal.service.persistence.ShardPersistence shardPersistence;
1506    @BeanReference(name = "com.liferay.portal.service.persistence.SubscriptionPersistence.impl")
1507    protected com.liferay.portal.service.persistence.SubscriptionPersistence subscriptionPersistence;
1508    @BeanReference(name = "com.liferay.portal.service.persistence.UserPersistence.impl")
1509    protected com.liferay.portal.service.persistence.UserPersistence userPersistence;
1510    @BeanReference(name = "com.liferay.portal.service.persistence.UserGroupPersistence.impl")
1511    protected com.liferay.portal.service.persistence.UserGroupPersistence userGroupPersistence;
1512    @BeanReference(name = "com.liferay.portal.service.persistence.UserGroupRolePersistence.impl")
1513    protected com.liferay.portal.service.persistence.UserGroupRolePersistence userGroupRolePersistence;
1514    @BeanReference(name = "com.liferay.portal.service.persistence.UserIdMapperPersistence.impl")
1515    protected com.liferay.portal.service.persistence.UserIdMapperPersistence userIdMapperPersistence;
1516    @BeanReference(name = "com.liferay.portal.service.persistence.UserTrackerPersistence.impl")
1517    protected com.liferay.portal.service.persistence.UserTrackerPersistence userTrackerPersistence;
1518    @BeanReference(name = "com.liferay.portal.service.persistence.UserTrackerPathPersistence.impl")
1519    protected com.liferay.portal.service.persistence.UserTrackerPathPersistence userTrackerPathPersistence;
1520    @BeanReference(name = "com.liferay.portal.service.persistence.WebDAVPropsPersistence.impl")
1521    protected com.liferay.portal.service.persistence.WebDAVPropsPersistence webDAVPropsPersistence;
1522    @BeanReference(name = "com.liferay.portal.service.persistence.WebsitePersistence.impl")
1523    protected com.liferay.portal.service.persistence.WebsitePersistence websitePersistence;
1524    private static Log _log = LogFactoryUtil.getLog(ResourceCodePersistenceImpl.class);
1525}