001    /**
002     * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
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_WITH_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_WITHOUT_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            @Override
149            public void clearCache(List<ClusterGroup> clusterGroups) {
150                    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
151                    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
152    
153                    for (ClusterGroup clusterGroup : clusterGroups) {
154                            EntityCacheUtil.removeResult(ClusterGroupModelImpl.ENTITY_CACHE_ENABLED,
155                                    ClusterGroupImpl.class, clusterGroup.getPrimaryKey());
156                    }
157            }
158    
159            /**
160             * Creates a new cluster group with the primary key. Does not add the cluster group to the database.
161             *
162             * @param clusterGroupId the primary key for the new cluster group
163             * @return the new cluster group
164             */
165            public ClusterGroup create(long clusterGroupId) {
166                    ClusterGroup clusterGroup = new ClusterGroupImpl();
167    
168                    clusterGroup.setNew(true);
169                    clusterGroup.setPrimaryKey(clusterGroupId);
170    
171                    return clusterGroup;
172            }
173    
174            /**
175             * Removes the cluster group with the primary key from the database. Also notifies the appropriate model listeners.
176             *
177             * @param clusterGroupId the primary key of the cluster group
178             * @return the cluster group that was removed
179             * @throws com.liferay.portal.NoSuchClusterGroupException if a cluster group with the primary key could not be found
180             * @throws SystemException if a system exception occurred
181             */
182            public ClusterGroup remove(long clusterGroupId)
183                    throws NoSuchClusterGroupException, SystemException {
184                    return remove(Long.valueOf(clusterGroupId));
185            }
186    
187            /**
188             * Removes the cluster group with the primary key from the database. Also notifies the appropriate model listeners.
189             *
190             * @param primaryKey the primary key of the cluster group
191             * @return the cluster group that was removed
192             * @throws com.liferay.portal.NoSuchClusterGroupException if a cluster group with the primary key could not be found
193             * @throws SystemException if a system exception occurred
194             */
195            @Override
196            public ClusterGroup remove(Serializable primaryKey)
197                    throws NoSuchClusterGroupException, SystemException {
198                    Session session = null;
199    
200                    try {
201                            session = openSession();
202    
203                            ClusterGroup clusterGroup = (ClusterGroup)session.get(ClusterGroupImpl.class,
204                                            primaryKey);
205    
206                            if (clusterGroup == null) {
207                                    if (_log.isWarnEnabled()) {
208                                            _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + primaryKey);
209                                    }
210    
211                                    throw new NoSuchClusterGroupException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
212                                            primaryKey);
213                            }
214    
215                            return remove(clusterGroup);
216                    }
217                    catch (NoSuchClusterGroupException nsee) {
218                            throw nsee;
219                    }
220                    catch (Exception e) {
221                            throw processException(e);
222                    }
223                    finally {
224                            closeSession(session);
225                    }
226            }
227    
228            @Override
229            protected ClusterGroup removeImpl(ClusterGroup clusterGroup)
230                    throws SystemException {
231                    clusterGroup = toUnwrappedModel(clusterGroup);
232    
233                    Session session = null;
234    
235                    try {
236                            session = openSession();
237    
238                            if (clusterGroup.isCachedModel()) {
239                                    clusterGroup = (ClusterGroup)session.get(ClusterGroupImpl.class,
240                                                    clusterGroup.getPrimaryKeyObj());
241                            }
242    
243                            session.delete(clusterGroup);
244                    }
245                    catch (Exception e) {
246                            throw processException(e);
247                    }
248                    finally {
249                            closeSession(session);
250                    }
251    
252                    clearCache(clusterGroup);
253    
254                    return clusterGroup;
255            }
256    
257            @Override
258            public ClusterGroup updateImpl(
259                    com.liferay.portal.model.ClusterGroup clusterGroup)
260                    throws SystemException {
261                    clusterGroup = toUnwrappedModel(clusterGroup);
262    
263                    boolean isNew = clusterGroup.isNew();
264    
265                    Session session = null;
266    
267                    try {
268                            session = openSession();
269    
270                            if (clusterGroup.isNew()) {
271                                    session.save(clusterGroup);
272    
273                                    clusterGroup.setNew(false);
274                            }
275                            else {
276                                    session.merge(clusterGroup);
277                            }
278                    }
279                    catch (Exception e) {
280                            throw processException(e);
281                    }
282                    finally {
283                            closeSession(session);
284                    }
285    
286                    FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITH_PAGINATION);
287    
288                    if (isNew) {
289                            FinderCacheUtil.clearCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
290                    }
291    
292                    EntityCacheUtil.putResult(ClusterGroupModelImpl.ENTITY_CACHE_ENABLED,
293                            ClusterGroupImpl.class, clusterGroup.getPrimaryKey(), clusterGroup);
294    
295                    return clusterGroup;
296            }
297    
298            protected ClusterGroup toUnwrappedModel(ClusterGroup clusterGroup) {
299                    if (clusterGroup instanceof ClusterGroupImpl) {
300                            return clusterGroup;
301                    }
302    
303                    ClusterGroupImpl clusterGroupImpl = new ClusterGroupImpl();
304    
305                    clusterGroupImpl.setNew(clusterGroup.isNew());
306                    clusterGroupImpl.setPrimaryKey(clusterGroup.getPrimaryKey());
307    
308                    clusterGroupImpl.setClusterGroupId(clusterGroup.getClusterGroupId());
309                    clusterGroupImpl.setName(clusterGroup.getName());
310                    clusterGroupImpl.setClusterNodeIds(clusterGroup.getClusterNodeIds());
311                    clusterGroupImpl.setWholeCluster(clusterGroup.isWholeCluster());
312    
313                    return clusterGroupImpl;
314            }
315    
316            /**
317             * Returns the cluster group with the primary key or throws a {@link com.liferay.portal.NoSuchModelException} if it could not be found.
318             *
319             * @param primaryKey the primary key of the cluster group
320             * @return the cluster group
321             * @throws com.liferay.portal.NoSuchModelException if a cluster group with the primary key could not be found
322             * @throws SystemException if a system exception occurred
323             */
324            @Override
325            public ClusterGroup findByPrimaryKey(Serializable primaryKey)
326                    throws NoSuchModelException, SystemException {
327                    return findByPrimaryKey(((Long)primaryKey).longValue());
328            }
329    
330            /**
331             * Returns the cluster group with the primary key or throws a {@link com.liferay.portal.NoSuchClusterGroupException} if it could not be found.
332             *
333             * @param clusterGroupId the primary key of the cluster group
334             * @return the cluster group
335             * @throws com.liferay.portal.NoSuchClusterGroupException if a cluster group with the primary key could not be found
336             * @throws SystemException if a system exception occurred
337             */
338            public ClusterGroup findByPrimaryKey(long clusterGroupId)
339                    throws NoSuchClusterGroupException, SystemException {
340                    ClusterGroup clusterGroup = fetchByPrimaryKey(clusterGroupId);
341    
342                    if (clusterGroup == null) {
343                            if (_log.isWarnEnabled()) {
344                                    _log.warn(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY + clusterGroupId);
345                            }
346    
347                            throw new NoSuchClusterGroupException(_NO_SUCH_ENTITY_WITH_PRIMARY_KEY +
348                                    clusterGroupId);
349                    }
350    
351                    return clusterGroup;
352            }
353    
354            /**
355             * Returns the cluster group with the primary key or returns <code>null</code> if it could not be found.
356             *
357             * @param primaryKey the primary key of the cluster group
358             * @return the cluster group, or <code>null</code> if a cluster group with the primary key could not be found
359             * @throws SystemException if a system exception occurred
360             */
361            @Override
362            public ClusterGroup fetchByPrimaryKey(Serializable primaryKey)
363                    throws SystemException {
364                    return fetchByPrimaryKey(((Long)primaryKey).longValue());
365            }
366    
367            /**
368             * Returns the cluster group with the primary key or returns <code>null</code> if it could not be found.
369             *
370             * @param clusterGroupId the primary key of the cluster group
371             * @return the cluster group, or <code>null</code> if a cluster group with the primary key could not be found
372             * @throws SystemException if a system exception occurred
373             */
374            public ClusterGroup fetchByPrimaryKey(long clusterGroupId)
375                    throws SystemException {
376                    ClusterGroup clusterGroup = (ClusterGroup)EntityCacheUtil.getResult(ClusterGroupModelImpl.ENTITY_CACHE_ENABLED,
377                                    ClusterGroupImpl.class, clusterGroupId);
378    
379                    if (clusterGroup == _nullClusterGroup) {
380                            return null;
381                    }
382    
383                    if (clusterGroup == null) {
384                            Session session = null;
385    
386                            boolean hasException = false;
387    
388                            try {
389                                    session = openSession();
390    
391                                    clusterGroup = (ClusterGroup)session.get(ClusterGroupImpl.class,
392                                                    Long.valueOf(clusterGroupId));
393                            }
394                            catch (Exception e) {
395                                    hasException = true;
396    
397                                    throw processException(e);
398                            }
399                            finally {
400                                    if (clusterGroup != null) {
401                                            cacheResult(clusterGroup);
402                                    }
403                                    else if (!hasException) {
404                                            EntityCacheUtil.putResult(ClusterGroupModelImpl.ENTITY_CACHE_ENABLED,
405                                                    ClusterGroupImpl.class, clusterGroupId,
406                                                    _nullClusterGroup);
407                                    }
408    
409                                    closeSession(session);
410                            }
411                    }
412    
413                    return clusterGroup;
414            }
415    
416            /**
417             * Returns all the cluster groups.
418             *
419             * @return the cluster groups
420             * @throws SystemException if a system exception occurred
421             */
422            public List<ClusterGroup> findAll() throws SystemException {
423                    return findAll(QueryUtil.ALL_POS, QueryUtil.ALL_POS, null);
424            }
425    
426            /**
427             * Returns a range of all the cluster groups.
428             *
429             * <p>
430             * 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.
431             * </p>
432             *
433             * @param start the lower bound of the range of cluster groups
434             * @param end the upper bound of the range of cluster groups (not inclusive)
435             * @return the range of cluster groups
436             * @throws SystemException if a system exception occurred
437             */
438            public List<ClusterGroup> findAll(int start, int end)
439                    throws SystemException {
440                    return findAll(start, end, null);
441            }
442    
443            /**
444             * Returns an ordered range of all the cluster groups.
445             *
446             * <p>
447             * 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.
448             * </p>
449             *
450             * @param start the lower bound of the range of cluster groups
451             * @param end the upper bound of the range of cluster groups (not inclusive)
452             * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
453             * @return the ordered range of cluster groups
454             * @throws SystemException if a system exception occurred
455             */
456            public List<ClusterGroup> findAll(int start, int end,
457                    OrderByComparator orderByComparator) throws SystemException {
458                    FinderPath finderPath = null;
459                    Object[] finderArgs = new Object[] { start, end, orderByComparator };
460    
461                    if ((start == QueryUtil.ALL_POS) && (end == QueryUtil.ALL_POS) &&
462                                    (orderByComparator == null)) {
463                            finderPath = FINDER_PATH_WITHOUT_PAGINATION_FIND_ALL;
464                            finderArgs = FINDER_ARGS_EMPTY;
465                    }
466                    else {
467                            finderPath = FINDER_PATH_WITH_PAGINATION_FIND_ALL;
468                            finderArgs = new Object[] { start, end, orderByComparator };
469                    }
470    
471                    List<ClusterGroup> list = (List<ClusterGroup>)FinderCacheUtil.getResult(finderPath,
472                                    finderArgs, this);
473    
474                    if (list == null) {
475                            StringBundler query = null;
476                            String sql = null;
477    
478                            if (orderByComparator != null) {
479                                    query = new StringBundler(2 +
480                                                    (orderByComparator.getOrderByFields().length * 3));
481    
482                                    query.append(_SQL_SELECT_CLUSTERGROUP);
483    
484                                    appendOrderByComparator(query, _ORDER_BY_ENTITY_ALIAS,
485                                            orderByComparator);
486    
487                                    sql = query.toString();
488                            }
489                            else {
490                                    sql = _SQL_SELECT_CLUSTERGROUP;
491                            }
492    
493                            Session session = null;
494    
495                            try {
496                                    session = openSession();
497    
498                                    Query q = session.createQuery(sql);
499    
500                                    if (orderByComparator == null) {
501                                            list = (List<ClusterGroup>)QueryUtil.list(q, getDialect(),
502                                                            start, end, false);
503    
504                                            Collections.sort(list);
505                                    }
506                                    else {
507                                            list = (List<ClusterGroup>)QueryUtil.list(q, getDialect(),
508                                                            start, end);
509                                    }
510                            }
511                            catch (Exception e) {
512                                    throw processException(e);
513                            }
514                            finally {
515                                    if (list == null) {
516                                            FinderCacheUtil.removeResult(finderPath, finderArgs);
517                                    }
518                                    else {
519                                            cacheResult(list);
520    
521                                            FinderCacheUtil.putResult(finderPath, finderArgs, list);
522                                    }
523    
524                                    closeSession(session);
525                            }
526                    }
527    
528                    return list;
529            }
530    
531            /**
532             * Removes all the cluster groups from the database.
533             *
534             * @throws SystemException if a system exception occurred
535             */
536            public void removeAll() throws SystemException {
537                    for (ClusterGroup clusterGroup : findAll()) {
538                            remove(clusterGroup);
539                    }
540            }
541    
542            /**
543             * Returns the number of cluster groups.
544             *
545             * @return the number of cluster groups
546             * @throws SystemException if a system exception occurred
547             */
548            public int countAll() throws SystemException {
549                    Long count = (Long)FinderCacheUtil.getResult(FINDER_PATH_COUNT_ALL,
550                                    FINDER_ARGS_EMPTY, this);
551    
552                    if (count == null) {
553                            Session session = null;
554    
555                            try {
556                                    session = openSession();
557    
558                                    Query q = session.createQuery(_SQL_COUNT_CLUSTERGROUP);
559    
560                                    count = (Long)q.uniqueResult();
561                            }
562                            catch (Exception e) {
563                                    throw processException(e);
564                            }
565                            finally {
566                                    if (count == null) {
567                                            count = Long.valueOf(0);
568                                    }
569    
570                                    FinderCacheUtil.putResult(FINDER_PATH_COUNT_ALL,
571                                            FINDER_ARGS_EMPTY, count);
572    
573                                    closeSession(session);
574                            }
575                    }
576    
577                    return count.intValue();
578            }
579    
580            /**
581             * Initializes the cluster group persistence.
582             */
583            public void afterPropertiesSet() {
584                    String[] listenerClassNames = StringUtil.split(GetterUtil.getString(
585                                            com.liferay.portal.util.PropsUtil.get(
586                                                    "value.object.listener.com.liferay.portal.model.ClusterGroup")));
587    
588                    if (listenerClassNames.length > 0) {
589                            try {
590                                    List<ModelListener<ClusterGroup>> listenersList = new ArrayList<ModelListener<ClusterGroup>>();
591    
592                                    for (String listenerClassName : listenerClassNames) {
593                                            listenersList.add((ModelListener<ClusterGroup>)InstanceFactory.newInstance(
594                                                            listenerClassName));
595                                    }
596    
597                                    listeners = listenersList.toArray(new ModelListener[listenersList.size()]);
598                            }
599                            catch (Exception e) {
600                                    _log.error(e);
601                            }
602                    }
603            }
604    
605            public void destroy() {
606                    EntityCacheUtil.removeCache(ClusterGroupImpl.class.getName());
607                    FinderCacheUtil.removeCache(FINDER_CLASS_NAME_ENTITY);
608                    FinderCacheUtil.removeCache(FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION);
609            }
610    
611            @BeanReference(type = AccountPersistence.class)
612            protected AccountPersistence accountPersistence;
613            @BeanReference(type = AddressPersistence.class)
614            protected AddressPersistence addressPersistence;
615            @BeanReference(type = BrowserTrackerPersistence.class)
616            protected BrowserTrackerPersistence browserTrackerPersistence;
617            @BeanReference(type = ClassNamePersistence.class)
618            protected ClassNamePersistence classNamePersistence;
619            @BeanReference(type = ClusterGroupPersistence.class)
620            protected ClusterGroupPersistence clusterGroupPersistence;
621            @BeanReference(type = CompanyPersistence.class)
622            protected CompanyPersistence companyPersistence;
623            @BeanReference(type = ContactPersistence.class)
624            protected ContactPersistence contactPersistence;
625            @BeanReference(type = CountryPersistence.class)
626            protected CountryPersistence countryPersistence;
627            @BeanReference(type = EmailAddressPersistence.class)
628            protected EmailAddressPersistence emailAddressPersistence;
629            @BeanReference(type = GroupPersistence.class)
630            protected GroupPersistence groupPersistence;
631            @BeanReference(type = ImagePersistence.class)
632            protected ImagePersistence imagePersistence;
633            @BeanReference(type = LayoutPersistence.class)
634            protected LayoutPersistence layoutPersistence;
635            @BeanReference(type = LayoutBranchPersistence.class)
636            protected LayoutBranchPersistence layoutBranchPersistence;
637            @BeanReference(type = LayoutPrototypePersistence.class)
638            protected LayoutPrototypePersistence layoutPrototypePersistence;
639            @BeanReference(type = LayoutRevisionPersistence.class)
640            protected LayoutRevisionPersistence layoutRevisionPersistence;
641            @BeanReference(type = LayoutSetPersistence.class)
642            protected LayoutSetPersistence layoutSetPersistence;
643            @BeanReference(type = LayoutSetBranchPersistence.class)
644            protected LayoutSetBranchPersistence layoutSetBranchPersistence;
645            @BeanReference(type = LayoutSetPrototypePersistence.class)
646            protected LayoutSetPrototypePersistence layoutSetPrototypePersistence;
647            @BeanReference(type = ListTypePersistence.class)
648            protected ListTypePersistence listTypePersistence;
649            @BeanReference(type = LockPersistence.class)
650            protected LockPersistence lockPersistence;
651            @BeanReference(type = MembershipRequestPersistence.class)
652            protected MembershipRequestPersistence membershipRequestPersistence;
653            @BeanReference(type = OrganizationPersistence.class)
654            protected OrganizationPersistence organizationPersistence;
655            @BeanReference(type = OrgGroupRolePersistence.class)
656            protected OrgGroupRolePersistence orgGroupRolePersistence;
657            @BeanReference(type = OrgLaborPersistence.class)
658            protected OrgLaborPersistence orgLaborPersistence;
659            @BeanReference(type = PasswordPolicyPersistence.class)
660            protected PasswordPolicyPersistence passwordPolicyPersistence;
661            @BeanReference(type = PasswordPolicyRelPersistence.class)
662            protected PasswordPolicyRelPersistence passwordPolicyRelPersistence;
663            @BeanReference(type = PasswordTrackerPersistence.class)
664            protected PasswordTrackerPersistence passwordTrackerPersistence;
665            @BeanReference(type = PhonePersistence.class)
666            protected PhonePersistence phonePersistence;
667            @BeanReference(type = PluginSettingPersistence.class)
668            protected PluginSettingPersistence pluginSettingPersistence;
669            @BeanReference(type = PortalPreferencesPersistence.class)
670            protected PortalPreferencesPersistence portalPreferencesPersistence;
671            @BeanReference(type = PortletPersistence.class)
672            protected PortletPersistence portletPersistence;
673            @BeanReference(type = PortletItemPersistence.class)
674            protected PortletItemPersistence portletItemPersistence;
675            @BeanReference(type = PortletPreferencesPersistence.class)
676            protected PortletPreferencesPersistence portletPreferencesPersistence;
677            @BeanReference(type = RegionPersistence.class)
678            protected RegionPersistence regionPersistence;
679            @BeanReference(type = ReleasePersistence.class)
680            protected ReleasePersistence releasePersistence;
681            @BeanReference(type = RepositoryPersistence.class)
682            protected RepositoryPersistence repositoryPersistence;
683            @BeanReference(type = RepositoryEntryPersistence.class)
684            protected RepositoryEntryPersistence repositoryEntryPersistence;
685            @BeanReference(type = ResourceActionPersistence.class)
686            protected ResourceActionPersistence resourceActionPersistence;
687            @BeanReference(type = ResourceBlockPersistence.class)
688            protected ResourceBlockPersistence resourceBlockPersistence;
689            @BeanReference(type = ResourceBlockPermissionPersistence.class)
690            protected ResourceBlockPermissionPersistence resourceBlockPermissionPersistence;
691            @BeanReference(type = ResourcePermissionPersistence.class)
692            protected ResourcePermissionPersistence resourcePermissionPersistence;
693            @BeanReference(type = ResourceTypePermissionPersistence.class)
694            protected ResourceTypePermissionPersistence resourceTypePermissionPersistence;
695            @BeanReference(type = RolePersistence.class)
696            protected RolePersistence rolePersistence;
697            @BeanReference(type = ServiceComponentPersistence.class)
698            protected ServiceComponentPersistence serviceComponentPersistence;
699            @BeanReference(type = ShardPersistence.class)
700            protected ShardPersistence shardPersistence;
701            @BeanReference(type = SubscriptionPersistence.class)
702            protected SubscriptionPersistence subscriptionPersistence;
703            @BeanReference(type = TeamPersistence.class)
704            protected TeamPersistence teamPersistence;
705            @BeanReference(type = TicketPersistence.class)
706            protected TicketPersistence ticketPersistence;
707            @BeanReference(type = UserPersistence.class)
708            protected UserPersistence userPersistence;
709            @BeanReference(type = UserGroupPersistence.class)
710            protected UserGroupPersistence userGroupPersistence;
711            @BeanReference(type = UserGroupGroupRolePersistence.class)
712            protected UserGroupGroupRolePersistence userGroupGroupRolePersistence;
713            @BeanReference(type = UserGroupRolePersistence.class)
714            protected UserGroupRolePersistence userGroupRolePersistence;
715            @BeanReference(type = UserIdMapperPersistence.class)
716            protected UserIdMapperPersistence userIdMapperPersistence;
717            @BeanReference(type = UserNotificationEventPersistence.class)
718            protected UserNotificationEventPersistence userNotificationEventPersistence;
719            @BeanReference(type = UserTrackerPersistence.class)
720            protected UserTrackerPersistence userTrackerPersistence;
721            @BeanReference(type = UserTrackerPathPersistence.class)
722            protected UserTrackerPathPersistence userTrackerPathPersistence;
723            @BeanReference(type = VirtualHostPersistence.class)
724            protected VirtualHostPersistence virtualHostPersistence;
725            @BeanReference(type = WebDAVPropsPersistence.class)
726            protected WebDAVPropsPersistence webDAVPropsPersistence;
727            @BeanReference(type = WebsitePersistence.class)
728            protected WebsitePersistence websitePersistence;
729            @BeanReference(type = WorkflowDefinitionLinkPersistence.class)
730            protected WorkflowDefinitionLinkPersistence workflowDefinitionLinkPersistence;
731            @BeanReference(type = WorkflowInstanceLinkPersistence.class)
732            protected WorkflowInstanceLinkPersistence workflowInstanceLinkPersistence;
733            private static final String _SQL_SELECT_CLUSTERGROUP = "SELECT clusterGroup FROM ClusterGroup clusterGroup";
734            private static final String _SQL_COUNT_CLUSTERGROUP = "SELECT COUNT(clusterGroup) FROM ClusterGroup clusterGroup";
735            private static final String _ORDER_BY_ENTITY_ALIAS = "clusterGroup.";
736            private static final String _NO_SUCH_ENTITY_WITH_PRIMARY_KEY = "No ClusterGroup exists with the primary key ";
737            private static final boolean _HIBERNATE_CACHE_USE_SECOND_LEVEL_CACHE = com.liferay.portal.util.PropsValues.HIBERNATE_CACHE_USE_SECOND_LEVEL_CACHE;
738            private static Log _log = LogFactoryUtil.getLog(ClusterGroupPersistenceImpl.class);
739            private static ClusterGroup _nullClusterGroup = new ClusterGroupImpl() {
740                            @Override
741                            public Object clone() {
742                                    return this;
743                            }
744    
745                            @Override
746                            public CacheModel<ClusterGroup> toCacheModel() {
747                                    return _nullClusterGroupCacheModel;
748                            }
749                    };
750    
751            private static CacheModel<ClusterGroup> _nullClusterGroupCacheModel = new CacheModel<ClusterGroup>() {
752                            public ClusterGroup toEntityModel() {
753                                    return _nullClusterGroup;
754                            }
755                    };
756    }