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