001    /**
002     * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
013     */
014    
015    package com.liferay.portal.service.persistence;
016    
017    import com.liferay.portal.NoSuchClusterGroupException;
018    import com.liferay.portal.NoSuchModelException;
019    import com.liferay.portal.kernel.bean.BeanReference;
020    import com.liferay.portal.kernel.cache.CacheRegistryUtil;
021    import com.liferay.portal.kernel.dao.orm.EntityCacheUtil;
022    import com.liferay.portal.kernel.dao.orm.FinderCacheUtil;
023    import com.liferay.portal.kernel.dao.orm.FinderPath;
024    import com.liferay.portal.kernel.dao.orm.Query;
025    import com.liferay.portal.kernel.dao.orm.QueryUtil;
026    import com.liferay.portal.kernel.dao.orm.Session;
027    import com.liferay.portal.kernel.exception.SystemException;
028    import com.liferay.portal.kernel.log.Log;
029    import com.liferay.portal.kernel.log.LogFactoryUtil;
030    import com.liferay.portal.kernel.util.GetterUtil;
031    import com.liferay.portal.kernel.util.InstanceFactory;
032    import com.liferay.portal.kernel.util.OrderByComparator;
033    import com.liferay.portal.kernel.util.StringBundler;
034    import com.liferay.portal.kernel.util.StringUtil;
035    import com.liferay.portal.model.CacheModel;
036    import com.liferay.portal.model.ClusterGroup;
037    import com.liferay.portal.model.ModelListener;
038    import com.liferay.portal.model.impl.ClusterGroupImpl;
039    import com.liferay.portal.model.impl.ClusterGroupModelImpl;
040    import com.liferay.portal.service.persistence.impl.BasePersistenceImpl;
041    
042    import java.io.Serializable;
043    
044    import java.util.ArrayList;
045    import java.util.Collections;
046    import java.util.List;
047    
048    /**
049     * The persistence implementation for the cluster group service.
050     *
051     * <p>
052     * Caching information and settings can be found in <code>portal.properties</code>
053     * </p>
054     *
055     * @author Brian Wing Shun Chan
056     * @see ClusterGroupPersistence
057     * @see ClusterGroupUtil
058     * @generated
059     */
060    public class ClusterGroupPersistenceImpl extends BasePersistenceImpl<ClusterGroup>
061            implements ClusterGroupPersistence {
062            /*
063             * NOTE FOR DEVELOPERS:
064             *
065             * Never modify or reference this class directly. Always use {@link ClusterGroupUtil} to access the cluster group persistence. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class.
066             */
067            public static final String FINDER_CLASS_NAME_ENTITY = ClusterGroupImpl.class.getName();
068            public static final String FINDER_CLASS_NAME_LIST_WITH_PAGINATION = FINDER_CLASS_NAME_ENTITY +
069                    ".List1";
070            public static final String FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION = FINDER_CLASS_NAME_ENTITY +
071                    ".List2";
072            public static final FinderPath FINDER_PATH_WITH_PAGINATION_FIND_ALL = new FinderPath(ClusterGroupModelImpl.ENTITY_CACHE_ENABLED,
073                            ClusterGroupModelImpl.FINDER_CACHE_ENABLED, ClusterGroupImpl.class,
074                            FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "findAll", new String[0]);
075            public static final FinderPath FINDER_PATH_WITHOUT_PAGINATION_FIND_ALL = new FinderPath(ClusterGroupModelImpl.ENTITY_CACHE_ENABLED,
076                            ClusterGroupModelImpl.FINDER_CACHE_ENABLED, ClusterGroupImpl.class,
077                            FINDER_CLASS_NAME_LIST_WITH_PAGINATION, "findAll", new String[0]);
078            public static final FinderPath FINDER_PATH_COUNT_ALL = new FinderPath(ClusterGroupModelImpl.ENTITY_CACHE_ENABLED,
079                            ClusterGroupModelImpl.FINDER_CACHE_ENABLED, Long.class,
080                            FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION, "countAll", new String[0]);
081    
082            /**
083             * Caches the cluster group in the entity cache if it is enabled.
084             *
085             * @param clusterGroup the cluster group
086             */
087            public void cacheResult(ClusterGroup clusterGroup) {
088                    EntityCacheUtil.putResult(ClusterGroupModelImpl.ENTITY_CACHE_ENABLED,
089                            ClusterGroupImpl.class, clusterGroup.getPrimaryKey(), clusterGroup);
090    
091                    clusterGroup.resetOriginalValues();
092            }
093    
094            /**
095             * Caches the cluster groups in the entity cache if it is enabled.
096             *
097             * @param clusterGroups the cluster groups
098             */
099            public void cacheResult(List<ClusterGroup> clusterGroups) {
100                    for (ClusterGroup clusterGroup : clusterGroups) {
101                            if (EntityCacheUtil.getResult(
102                                                    ClusterGroupModelImpl.ENTITY_CACHE_ENABLED,
103                                                    ClusterGroupImpl.class, clusterGroup.getPrimaryKey()) == null) {
104                                    cacheResult(clusterGroup);
105                            }
106                            else {
107                                    clusterGroup.resetOriginalValues();
108                            }
109                    }
110            }
111    
112            /**
113             * Clears the cache for all cluster groups.
114             *
115             * <p>
116             * The {@link com.liferay.portal.kernel.dao.orm.EntityCache} and {@link com.liferay.portal.kernel.dao.orm.FinderCache} are both cleared by this method.
117             * </p>
118             */
119            @Override
120            public void clearCache() {
121                    if (_HIBERNATE_CACHE_USE_SECOND_LEVEL_CACHE) {
122                            CacheRegistryUtil.clear(ClusterGroupImpl.class.getName());
123                    }
124    
125                    EntityCacheUtil.clearCache(ClusterGroupImpl.class.getName());
126    
127                    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_ENTITY);
128                    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
129                    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
130            }
131    
132            /**
133             * Clears the cache for the cluster group.
134             *
135             * <p>
136             * The {@link com.liferay.portal.kernel.dao.orm.EntityCache} and {@link com.liferay.portal.kernel.dao.orm.FinderCache} are both cleared by this method.
137             * </p>
138             */
139            @Override
140            public void clearCache(ClusterGroup clusterGroup) {
141                    EntityCacheUtil.removeResult(ClusterGroupModelImpl.ENTITY_CACHE_ENABLED,
142                            ClusterGroupImpl.class, clusterGroup.getPrimaryKey());
143    
144                    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
145                    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
146            }
147    
148            /**
149             * Creates a new cluster group with the primary key. Does not add the cluster group to the database.
150             *
151             * @param clusterGroupId the primary key for the new cluster group
152             * @return the new cluster group
153             */
154            public ClusterGroup create(long clusterGroupId) {
155                    ClusterGroup clusterGroup = new ClusterGroupImpl();
156    
157                    clusterGroup.setNew(true);
158                    clusterGroup.setPrimaryKey(clusterGroupId);
159    
160                    return clusterGroup;
161            }
162    
163            /**
164             * Removes the cluster group with the primary key from the database. Also notifies the appropriate model listeners.
165             *
166             * @param primaryKey the primary key of the cluster group
167             * @return the cluster group that was removed
168             * @throws com.liferay.portal.NoSuchModelException if a cluster group with the primary key could not be found
169             * @throws SystemException if a system exception occurred
170             */
171            @Override
172            public ClusterGroup remove(Serializable primaryKey)
173                    throws NoSuchModelException, SystemException {
174                    return remove(((Long)primaryKey).longValue());
175            }
176    
177            /**
178             * Removes the cluster group with the primary key from the database. Also notifies the appropriate model listeners.
179             *
180             * @param clusterGroupId the primary key of the cluster group
181             * @return the cluster group that was removed
182             * @throws com.liferay.portal.NoSuchClusterGroupException if a cluster group with the primary key could not be found
183             * @throws SystemException if a system exception occurred
184             */
185            public ClusterGroup remove(long clusterGroupId)
186                    throws NoSuchClusterGroupException, SystemException {
187                    Session session = null;
188    
189                    try {
190                            session = openSession();
191    
192                            ClusterGroup clusterGroup = (ClusterGroup)session.get(ClusterGroupImpl.class,
193                                            Long.valueOf(clusterGroupId));
194    
195                            if (clusterGroup == null) {
196                                    if (_log.isWarnEnabled()) {
197                                            _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
198                                                    clusterGroupId);
199                                    }
200    
201                                    throw new NoSuchClusterGroupException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
202                                            clusterGroupId);
203                            }
204    
205                            return clusterGroupPersistence.remove(clusterGroup);
206                    }
207                    catch (NoSuchClusterGroupException nsee) {
208                            throw nsee;
209                    }
210                    catch (Exception e) {
211                            throw processException(e);
212                    }
213                    finally {
214                            closeSession(session);
215                    }
216            }
217    
218            /**
219             * Removes the cluster group from the database. Also notifies the appropriate model listeners.
220             *
221             * @param clusterGroup the cluster group
222             * @return the cluster group that was removed
223             * @throws SystemException if a system exception occurred
224             */
225            @Override
226            public ClusterGroup remove(ClusterGroup clusterGroup)
227                    throws SystemException {
228                    return super.remove(clusterGroup);
229            }
230    
231            @Override
232            protected ClusterGroup removeImpl(ClusterGroup clusterGroup)
233                    throws SystemException {
234                    clusterGroup = toUnwrappedModel(clusterGroup);
235    
236                    Session session = null;
237    
238                    try {
239                            session = openSession();
240    
241                            BatchSessionUtil.delete(session, clusterGroup);
242                    }
243                    catch (Exception e) {
244                            throw processException(e);
245                    }
246                    finally {
247                            closeSession(session);
248                    }
249    
250                    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
251                    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
252    
253                    EntityCacheUtil.removeResult(ClusterGroupModelImpl.ENTITY_CACHE_ENABLED,
254                            ClusterGroupImpl.class, clusterGroup.getPrimaryKey());
255    
256                    return clusterGroup;
257            }
258    
259            @Override
260            public ClusterGroup updateImpl(
261                    com.liferay.portal.model.ClusterGroup clusterGroup, boolean merge)
262                    throws SystemException {
263                    clusterGroup = toUnwrappedModel(clusterGroup);
264    
265                    Session session = null;
266    
267                    try {
268                            session = openSession();
269    
270                            BatchSessionUtil.update(session, clusterGroup, merge);
271    
272                            clusterGroup.setNew(false);
273                    }
274                    catch (Exception e) {
275                            throw processException(e);
276                    }
277                    finally {
278                            closeSession(session);
279                    }
280    
281                    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
282    
283                    EntityCacheUtil.putResult(ClusterGroupModelImpl.ENTITY_CACHE_ENABLED,
284                            ClusterGroupImpl.class, clusterGroup.getPrimaryKey(), clusterGroup);
285    
286                    return clusterGroup;
287            }
288    
289            protected ClusterGroup toUnwrappedModel(ClusterGroup clusterGroup) {
290                    if (clusterGroup instanceof ClusterGroupImpl) {
291                            return clusterGroup;
292                    }
293    
294                    ClusterGroupImpl clusterGroupImpl = new ClusterGroupImpl();
295    
296                    clusterGroupImpl.setNew(clusterGroup.isNew());
297                    clusterGroupImpl.setPrimaryKey(clusterGroup.getPrimaryKey());
298    
299                    clusterGroupImpl.setClusterGroupId(clusterGroup.getClusterGroupId());
300                    clusterGroupImpl.setName(clusterGroup.getName());
301                    clusterGroupImpl.setClusterNodeIds(clusterGroup.getClusterNodeIds());
302                    clusterGroupImpl.setWholeCluster(clusterGroup.isWholeCluster());
303    
304                    return clusterGroupImpl;
305            }
306    
307            /**
308             * Returns the cluster group with the primary key or throws a {@link com.liferay.portal.NoSuchModelException} if it could not be found.
309             *
310             * @param primaryKey the primary key of the cluster group
311             * @return the cluster group
312             * @throws com.liferay.portal.NoSuchModelException if a cluster group with the primary key could not be found
313             * @throws SystemException if a system exception occurred
314             */
315            @Override
316            public ClusterGroup findByPrimaryKey(Serializable primaryKey)
317                    throws NoSuchModelException, SystemException {
318                    return findByPrimaryKey(((Long)primaryKey).longValue());
319            }
320    
321            /**
322             * Returns the cluster group with the primary key or throws a {@link com.liferay.portal.NoSuchClusterGroupException} if it could not be found.
323             *
324             * @param clusterGroupId the primary key of the cluster group
325             * @return the cluster group
326             * @throws com.liferay.portal.NoSuchClusterGroupException if a cluster group with the primary key could not be found
327             * @throws SystemException if a system exception occurred
328             */
329            public ClusterGroup findByPrimaryKey(long clusterGroupId)
330                    throws NoSuchClusterGroupException, SystemException {
331                    ClusterGroup clusterGroup = fetchByPrimaryKey(clusterGroupId);
332    
333                    if (clusterGroup == null) {
334                            if (_log.isWarnEnabled()) {
335                                    _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + clusterGroupId);
336                            }
337    
338                            throw new NoSuchClusterGroupException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
339                                    clusterGroupId);
340                    }
341    
342                    return clusterGroup;
343            }
344    
345            /**
346             * Returns the cluster group with the primary key or returns <code>null</code> if it could not be found.
347             *
348             * @param primaryKey the primary key of the cluster group
349             * @return the cluster group, or <code>null</code> if a cluster group with the primary key could not be found
350             * @throws SystemException if a system exception occurred
351             */
352            @Override
353            public ClusterGroup fetchByPrimaryKey(Serializable primaryKey)
354                    throws SystemException {
355                    return fetchByPrimaryKey(((Long)primaryKey).longValue());
356            }
357    
358            /**
359             * Returns the cluster group with the primary key or returns <code>null</code> if it could not be found.
360             *
361             * @param clusterGroupId the primary key of the cluster group
362             * @return the cluster group, or <code>null</code> if a cluster group with the primary key could not be found
363             * @throws SystemException if a system exception occurred
364             */
365            public ClusterGroup fetchByPrimaryKey(long clusterGroupId)
366                    throws SystemException {
367                    ClusterGroup clusterGroup = (ClusterGroup)EntityCacheUtil.getResult(ClusterGroupModelImpl.ENTITY_CACHE_ENABLED,
368                                    ClusterGroupImpl.class, clusterGroupId);
369    
370                    if (clusterGroup == _nullClusterGroup) {
371                            return null;
372                    }
373    
374                    if (clusterGroup == null) {
375                            Session session = null;
376    
377                            boolean hasException = false;
378    
379                            try {
380                                    session = openSession();
381    
382                                    clusterGroup = (ClusterGroup)session.get(ClusterGroupImpl.class,
383                                                    Long.valueOf(clusterGroupId));
384                            }
385                            catch (Exception e) {
386                                    hasException = true;
387    
388                                    throw processException(e);
389                            }
390                            finally {
391                                    if (clusterGroup != null) {
392                                            cacheResult(clusterGroup);
393                                    }
394                                    else if (!hasException) {
395                                            EntityCacheUtil.putResult(ClusterGroupModelImpl.ENTITY_CACHE_ENABLED,
396                                                    ClusterGroupImpl.class, clusterGroupId,
397                                                    _nullClusterGroup);
398                                    }
399    
400                                    closeSession(session);
401                            }
402                    }
403    
404                    return clusterGroup;
405            }
406    
407            /**
408             * Returns all the cluster groups.
409             *
410             * @return the cluster groups
411             * @throws SystemException if a system exception occurred
412             */
413            public List<ClusterGroup> findAll() throws SystemException {
414                    return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
415            }
416    
417            /**
418             * Returns a range of all the cluster groups.
419             *
420             * <p>
421             * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
422             * </p>
423             *
424             * @param start the lower bound of the range of cluster groups
425             * @param end the upper bound of the range of cluster groups (not inclusive)
426             * @return the range of cluster groups
427             * @throws SystemException if a system exception occurred
428             */
429            public List<ClusterGroup> findAll(int start, int end)
430                    throws SystemException {
431                    return findAll(start, end, null);
432            }
433    
434            /**
435             * Returns an ordered range of all the cluster groups.
436             *
437             * <p>
438             * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set.
439             * </p>
440             *
441             * @param start the lower bound of the range of cluster groups
442             * @param end the upper bound of the range of cluster groups (not inclusive)
443             * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
444             * @return the ordered range of cluster groups
445             * @throws SystemException if a system exception occurred
446             */
447            public List<ClusterGroup> findAll(int start, int end,
448                    OrderByComparator orderByComparator) throws SystemException {
449                    FinderPath finderPath = null;
450                    Object[] finderArgs = new Object[] { start, end, orderByComparator };
451    
452                    if ((start == QueryUtil.ALL_POS) && (end == QueryUtil.ALL_POS) &&
453                                    (orderByComparator == null)) {
454                            finderPath = FINDER_PATH_WITH_PAGINATION_FIND_ALL;
455                            finderArgs = FINDER_ARGS_EMPTY;
456                    }
457                    else {
458                            finderPath = FINDER_PATH_WITHOUT_PAGINATION_FIND_ALL;
459                            finderArgs = new Object[] { start, end, orderByComparator };
460                    }
461    
462                    List<ClusterGroup> list = (List<ClusterGroup>)FinderCacheUtil.getResult(finderPath,
463                                    finderArgs, this);
464    
465                    if (list == null) {
466                            StringBundler query = null;
467                            String sql = null;
468    
469                            if (orderByComparator != null) {
470                                    query = new StringBundler(2 +
471                                                    (orderByComparator.getOrderByFields().length * 3));
472    
473                                    query.append(_SQL_SELECT_CLUSTERGROUP);
474    
475                                    appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
476                                            orderByComparator);
477    
478                                    sql = query.toString();
479                            }
480                            else {
481                                    sql = _SQL_SELECT_CLUSTERGROUP;
482                            }
483    
484                            Session session = null;
485    
486                            try {
487                                    session = openSession();
488    
489                                    Query q = session.createQuery(sql);
490    
491                                    if (orderByComparator == null) {
492                                            list = (List<ClusterGroup>)QueryUtil.list(q, getDialect(),
493                                                            start, end, false);
494    
495                                            Collections.sort(list);
496                                    }
497                                    else {
498                                            list = (List<ClusterGroup>)QueryUtil.list(q, getDialect(),
499                                                            start, end);
500                                    }
501                            }
502                            catch (Exception e) {
503                                    throw processException(e);
504                            }
505                            finally {
506                                    if (list == null) {
507                                            FinderCacheUtil.removeResult(finderPath, finderArgs);
508                                    }
509                                    else {
510                                            cacheResult(list);
511    
512                                            FinderCacheUtil.putResult(finderPath, finderArgs, list);
513                                    }
514    
515                                    closeSession(session);
516                            }
517                    }
518    
519                    return list;
520            }
521    
522            /**
523             * Removes all the cluster groups from the database.
524             *
525             * @throws SystemException if a system exception occurred
526             */
527            public void removeAll() throws SystemException {
528                    for (ClusterGroup clusterGroup : findAll()) {
529                            clusterGroupPersistence.remove(clusterGroup);
530                    }
531            }
532    
533            /**
534             * Returns the number of cluster groups.
535             *
536             * @return the number of cluster groups
537             * @throws SystemException if a system exception occurred
538             */
539            public int countAll() throws SystemException {
540                    Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_ALL,
541                                    FINDER_ARGS_EMPTY, this);
542    
543                    if (count == null) {
544                            Session session = null;
545    
546                            try {
547                                    session = openSession();
548    
549                                    Query q = session.createQuery(_SQL_COUNT_CLUSTERGROUP);
550    
551                                    count = (Long)q.uniqueResult();
552                            }
553                            catch (Exception e) {
554                                    throw processException(e);
555                            }
556                            finally {
557                                    if (count == null) {
558                                            count = Long.valueOf(0);
559                                    }
560    
561                                    FinderCacheUtil.putResult(FINDER_PATH_COUNT_ALL,
562                                            FINDER_ARGS_EMPTY, count);
563    
564                                    closeSession(session);
565                            }
566                    }
567    
568                    return count.intValue();
569            }
570    
571            /**
572             * Initializes the cluster group persistence.
573             */
574            public void afterPropertiesSet() {
575                    String[] listenerClassNames = StringUtil.split(GetterUtil.getString(
576                                            com.liferay.portal.util.PropsUtil.get(
577                                                    "value.object.listener.com.liferay.portal.model.ClusterGroup")));
578    
579                    if (listenerClassNames.length > 0) {
580                            try {
581                                    List<ModelListener<ClusterGroup>> listenersList = new ArrayList<ModelListener<ClusterGroup>>();
582    
583                                    for (String listenerClassName : listenerClassNames) {
584                                            listenersList.add((ModelListener<ClusterGroup>)InstanceFactory.newInstance(
585                                                            listenerClassName));
586                                    }
587    
588                                    listeners = listenersList.toArray(new ModelListener[listenersList.size()]);
589                            }
590                            catch (Exception e) {
591                                    _log.error(e);
592                            }
593                    }
594            }
595    
596            public void destroy() {
597                    EntityCacheUtil.removeCache(ClusterGroupImpl.class.getName());
598                    FinderCacheUtil.removeCache(FINDER_CLASS_NAME_ENTITY);
599                    FinderCacheUtil.removeCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
600            }
601    
602            @BeanReference(type = AccountPersistence.class)
603            protected AccountPersistence accountPersistence;
604            @BeanReference(type = AddressPersistence.class)
605            protected AddressPersistence addressPersistence;
606            @BeanReference(type = BrowserTrackerPersistence.class)
607            protected BrowserTrackerPersistence browserTrackerPersistence;
608            @BeanReference(type = ClassNamePersistence.class)
609            protected ClassNamePersistence classNamePersistence;
610            @BeanReference(type = ClusterGroupPersistence.class)
611            protected ClusterGroupPersistence clusterGroupPersistence;
612            @BeanReference(type = CompanyPersistence.class)
613            protected CompanyPersistence companyPersistence;
614            @BeanReference(type = ContactPersistence.class)
615            protected ContactPersistence contactPersistence;
616            @BeanReference(type = CountryPersistence.class)
617            protected CountryPersistence countryPersistence;
618            @BeanReference(type = EmailAddressPersistence.class)
619            protected EmailAddressPersistence emailAddressPersistence;
620            @BeanReference(type = GroupPersistence.class)
621            protected GroupPersistence groupPersistence;
622            @BeanReference(type = ImagePersistence.class)
623            protected ImagePersistence imagePersistence;
624            @BeanReference(type = LayoutPersistence.class)
625            protected LayoutPersistence layoutPersistence;
626            @BeanReference(type = LayoutBranchPersistence.class)
627            protected LayoutBranchPersistence layoutBranchPersistence;
628            @BeanReference(type = LayoutPrototypePersistence.class)
629            protected LayoutPrototypePersistence layoutPrototypePersistence;
630            @BeanReference(type = LayoutRevisionPersistence.class)
631            protected LayoutRevisionPersistence layoutRevisionPersistence;
632            @BeanReference(type = LayoutSetPersistence.class)
633            protected LayoutSetPersistence layoutSetPersistence;
634            @BeanReference(type = LayoutSetBranchPersistence.class)
635            protected LayoutSetBranchPersistence layoutSetBranchPersistence;
636            @BeanReference(type = LayoutSetPrototypePersistence.class)
637            protected LayoutSetPrototypePersistence layoutSetPrototypePersistence;
638            @BeanReference(type = ListTypePersistence.class)
639            protected ListTypePersistence listTypePersistence;
640            @BeanReference(type = LockPersistence.class)
641            protected LockPersistence lockPersistence;
642            @BeanReference(type = MembershipRequestPersistence.class)
643            protected MembershipRequestPersistence membershipRequestPersistence;
644            @BeanReference(type = OrganizationPersistence.class)
645            protected OrganizationPersistence organizationPersistence;
646            @BeanReference(type = OrgGroupPermissionPersistence.class)
647            protected OrgGroupPermissionPersistence orgGroupPermissionPersistence;
648            @BeanReference(type = OrgGroupRolePersistence.class)
649            protected OrgGroupRolePersistence orgGroupRolePersistence;
650            @BeanReference(type = OrgLaborPersistence.class)
651            protected OrgLaborPersistence orgLaborPersistence;
652            @BeanReference(type = PasswordPolicyPersistence.class)
653            protected PasswordPolicyPersistence passwordPolicyPersistence;
654            @BeanReference(type = PasswordPolicyRelPersistence.class)
655            protected PasswordPolicyRelPersistence passwordPolicyRelPersistence;
656            @BeanReference(type = PasswordTrackerPersistence.class)
657            protected PasswordTrackerPersistence passwordTrackerPersistence;
658            @BeanReference(type = PermissionPersistence.class)
659            protected PermissionPersistence permissionPersistence;
660            @BeanReference(type = PhonePersistence.class)
661            protected PhonePersistence phonePersistence;
662            @BeanReference(type = PluginSettingPersistence.class)
663            protected PluginSettingPersistence pluginSettingPersistence;
664            @BeanReference(type = PortalPreferencesPersistence.class)
665            protected PortalPreferencesPersistence portalPreferencesPersistence;
666            @BeanReference(type = PortletPersistence.class)
667            protected PortletPersistence portletPersistence;
668            @BeanReference(type = PortletItemPersistence.class)
669            protected PortletItemPersistence portletItemPersistence;
670            @BeanReference(type = PortletPreferencesPersistence.class)
671            protected PortletPreferencesPersistence portletPreferencesPersistence;
672            @BeanReference(type = RegionPersistence.class)
673            protected RegionPersistence regionPersistence;
674            @BeanReference(type = ReleasePersistence.class)
675            protected ReleasePersistence releasePersistence;
676            @BeanReference(type = RepositoryPersistence.class)
677            protected RepositoryPersistence repositoryPersistence;
678            @BeanReference(type = RepositoryEntryPersistence.class)
679            protected RepositoryEntryPersistence repositoryEntryPersistence;
680            @BeanReference(type = ResourcePersistence.class)
681            protected ResourcePersistence resourcePersistence;
682            @BeanReference(type = ResourceActionPersistence.class)
683            protected ResourceActionPersistence resourceActionPersistence;
684            @BeanReference(type = ResourceBlockPersistence.class)
685            protected ResourceBlockPersistence resourceBlockPersistence;
686            @BeanReference(type = ResourceBlockPermissionPersistence.class)
687            protected ResourceBlockPermissionPersistence resourceBlockPermissionPersistence;
688            @BeanReference(type = ResourceCodePersistence.class)
689            protected ResourceCodePersistence resourceCodePersistence;
690            @BeanReference(type = ResourcePermissionPersistence.class)
691            protected ResourcePermissionPersistence resourcePermissionPersistence;
692            @BeanReference(type = ResourceTypePermissionPersistence.class)
693            protected ResourceTypePermissionPersistence resourceTypePermissionPersistence;
694            @BeanReference(type = RolePersistence.class)
695            protected RolePersistence rolePersistence;
696            @BeanReference(type = ServiceComponentPersistence.class)
697            protected ServiceComponentPersistence serviceComponentPersistence;
698            @BeanReference(type = ShardPersistence.class)
699            protected ShardPersistence shardPersistence;
700            @BeanReference(type = SubscriptionPersistence.class)
701            protected SubscriptionPersistence subscriptionPersistence;
702            @BeanReference(type = TeamPersistence.class)
703            protected TeamPersistence teamPersistence;
704            @BeanReference(type = TicketPersistence.class)
705            protected TicketPersistence ticketPersistence;
706            @BeanReference(type = UserPersistence.class)
707            protected UserPersistence userPersistence;
708            @BeanReference(type = UserGroupPersistence.class)
709            protected UserGroupPersistence userGroupPersistence;
710            @BeanReference(type = UserGroupGroupRolePersistence.class)
711            protected UserGroupGroupRolePersistence userGroupGroupRolePersistence;
712            @BeanReference(type = UserGroupRolePersistence.class)
713            protected UserGroupRolePersistence userGroupRolePersistence;
714            @BeanReference(type = UserIdMapperPersistence.class)
715            protected UserIdMapperPersistence userIdMapperPersistence;
716            @BeanReference(type = UserNotificationEventPersistence.class)
717            protected UserNotificationEventPersistence userNotificationEventPersistence;
718            @BeanReference(type = UserTrackerPersistence.class)
719            protected UserTrackerPersistence userTrackerPersistence;
720            @BeanReference(type = UserTrackerPathPersistence.class)
721            protected UserTrackerPathPersistence userTrackerPathPersistence;
722            @BeanReference(type = VirtualHostPersistence.class)
723            protected VirtualHostPersistence virtualHostPersistence;
724            @BeanReference(type = WebDAVPropsPersistence.class)
725            protected WebDAVPropsPersistence webDAVPropsPersistence;
726            @BeanReference(type = WebsitePersistence.class)
727            protected WebsitePersistence websitePersistence;
728            @BeanReference(type = WorkflowDefinitionLinkPersistence.class)
729            protected WorkflowDefinitionLinkPersistence workflowDefinitionLinkPersistence;
730            @BeanReference(type = WorkflowInstanceLinkPersistence.class)
731            protected WorkflowInstanceLinkPersistence workflowInstanceLinkPersistence;
732            private static final String _SQL_SELECT_CLUSTERGROUP = "SELECT clusterGroup FROM ClusterGroup clusterGroup";
733            private static final String _SQL_COUNT_CLUSTERGROUP = "SELECT COUNT(clusterGroup) FROM ClusterGroup clusterGroup";
734            private static final String _ORDER_BY_ENTITY_ALIAS = "clusterGroup.";
735            private static final String _NO_SUCH_ENTITY_WITH_PRIMARY_KEY = "No ClusterGroup exists with the primary key ";
736            private static final boolean _HIBERNATE_CACHE_USE_SECOND_LEVEL_CACHE = com.liferay.portal.util.PropsValues.HIBERNATE_CACHE_USE_SECOND_LEVEL_CACHE;
737            private static Log _log = LogFactoryUtil.getLog(ClusterGroupPersistenceImpl.class);
738            private static ClusterGroup _nullClusterGroup = new ClusterGroupImpl() {
739                            @Override
740                            public Object clone() {
741                                    return this;
742                            }
743    
744                            @Override
745                            public CacheModel<ClusterGroup> toCacheModel() {
746                                    return _nullClusterGroupCacheModel;
747                            }
748                    };
749    
750            private static CacheModel<ClusterGroup> _nullClusterGroupCacheModel = new CacheModel<ClusterGroup>() {
751                            public ClusterGroup toEntityModel() {
752                                    return _nullClusterGroup;
753                            }
754                    };
755    }