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.kernel.bean.PortalBeanLocatorUtil;
018    import com.liferay.portal.kernel.dao.orm.DynamicQuery;
019    import com.liferay.portal.kernel.exception.SystemException;
020    import com.liferay.portal.kernel.util.OrderByComparator;
021    import com.liferay.portal.kernel.util.ReferenceRegistry;
022    import com.liferay.portal.model.ClusterGroup;
023    import com.liferay.portal.service.ServiceContext;
024    
025    import java.util.List;
026    
027    /**
028     * The persistence utility for the cluster group service. This utility wraps {@link ClusterGroupPersistenceImpl} and provides direct access to the database for CRUD operations. This utility should only be used by the service layer, as it must operate within a transaction. Never access this utility in a JSP, controller, model, or other front-end class.
029     *
030     * <p>
031     * Caching information and settings can be found in <code>portal.properties</code>
032     * </p>
033     *
034     * @author Brian Wing Shun Chan
035     * @see ClusterGroupPersistence
036     * @see ClusterGroupPersistenceImpl
037     * @generated
038     */
039    public class ClusterGroupUtil {
040            /*
041             * NOTE FOR DEVELOPERS:
042             *
043             * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this class.
044             */
045    
046            /**
047             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache()
048             */
049            public static void clearCache() {
050                    getPersistence().clearCache();
051            }
052    
053            /**
054             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel)
055             */
056            public static void clearCache(ClusterGroup clusterGroup) {
057                    getPersistence().clearCache(clusterGroup);
058            }
059    
060            /**
061             * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery)
062             */
063            public long countWithDynamicQuery(DynamicQuery dynamicQuery)
064                    throws SystemException {
065                    return getPersistence().countWithDynamicQuery(dynamicQuery);
066            }
067    
068            /**
069             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery)
070             */
071            public static List<ClusterGroup> findWithDynamicQuery(
072                    DynamicQuery dynamicQuery) throws SystemException {
073                    return getPersistence().findWithDynamicQuery(dynamicQuery);
074            }
075    
076            /**
077             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int)
078             */
079            public static List<ClusterGroup> findWithDynamicQuery(
080                    DynamicQuery dynamicQuery, int start, int end)
081                    throws SystemException {
082                    return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
083            }
084    
085            /**
086             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator)
087             */
088            public static List<ClusterGroup> findWithDynamicQuery(
089                    DynamicQuery dynamicQuery, int start, int end,
090                    OrderByComparator orderByComparator) throws SystemException {
091                    return getPersistence()
092                                       .findWithDynamicQuery(dynamicQuery, start, end,
093                            orderByComparator);
094            }
095    
096            /**
097             * @see com.liferay.portal.service.persistence.BasePersistence#remove(com.liferay.portal.model.BaseModel)
098             */
099            public static ClusterGroup remove(ClusterGroup clusterGroup)
100                    throws SystemException {
101                    return getPersistence().remove(clusterGroup);
102            }
103    
104            /**
105             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean)
106             */
107            public static ClusterGroup update(ClusterGroup clusterGroup, boolean merge)
108                    throws SystemException {
109                    return getPersistence().update(clusterGroup, merge);
110            }
111    
112            /**
113             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean, ServiceContext)
114             */
115            public static ClusterGroup update(ClusterGroup clusterGroup, boolean merge,
116                    ServiceContext serviceContext) throws SystemException {
117                    return getPersistence().update(clusterGroup, merge, serviceContext);
118            }
119    
120            /**
121            * Caches the cluster group in the entity cache if it is enabled.
122            *
123            * @param clusterGroup the cluster group
124            */
125            public static void cacheResult(
126                    com.liferay.portal.model.ClusterGroup clusterGroup) {
127                    getPersistence().cacheResult(clusterGroup);
128            }
129    
130            /**
131            * Caches the cluster groups in the entity cache if it is enabled.
132            *
133            * @param clusterGroups the cluster groups
134            */
135            public static void cacheResult(
136                    java.util.List<com.liferay.portal.model.ClusterGroup> clusterGroups) {
137                    getPersistence().cacheResult(clusterGroups);
138            }
139    
140            /**
141            * Creates a new cluster group with the primary key. Does not add the cluster group to the database.
142            *
143            * @param clusterGroupId the primary key for the new cluster group
144            * @return the new cluster group
145            */
146            public static com.liferay.portal.model.ClusterGroup create(
147                    long clusterGroupId) {
148                    return getPersistence().create(clusterGroupId);
149            }
150    
151            /**
152            * Removes the cluster group with the primary key from the database. Also notifies the appropriate model listeners.
153            *
154            * @param clusterGroupId the primary key of the cluster group
155            * @return the cluster group that was removed
156            * @throws com.liferay.portal.NoSuchClusterGroupException if a cluster group with the primary key could not be found
157            * @throws SystemException if a system exception occurred
158            */
159            public static com.liferay.portal.model.ClusterGroup remove(
160                    long clusterGroupId)
161                    throws com.liferay.portal.NoSuchClusterGroupException,
162                            com.liferay.portal.kernel.exception.SystemException {
163                    return getPersistence().remove(clusterGroupId);
164            }
165    
166            public static com.liferay.portal.model.ClusterGroup updateImpl(
167                    com.liferay.portal.model.ClusterGroup clusterGroup, boolean merge)
168                    throws com.liferay.portal.kernel.exception.SystemException {
169                    return getPersistence().updateImpl(clusterGroup, merge);
170            }
171    
172            /**
173            * Returns the cluster group with the primary key or throws a {@link com.liferay.portal.NoSuchClusterGroupException} if it could not be found.
174            *
175            * @param clusterGroupId the primary key of the cluster group
176            * @return the cluster group
177            * @throws com.liferay.portal.NoSuchClusterGroupException if a cluster group with the primary key could not be found
178            * @throws SystemException if a system exception occurred
179            */
180            public static com.liferay.portal.model.ClusterGroup findByPrimaryKey(
181                    long clusterGroupId)
182                    throws com.liferay.portal.NoSuchClusterGroupException,
183                            com.liferay.portal.kernel.exception.SystemException {
184                    return getPersistence().findByPrimaryKey(clusterGroupId);
185            }
186    
187            /**
188            * Returns the cluster group with the primary key or returns <code>null</code> if it could not be found.
189            *
190            * @param clusterGroupId the primary key of the cluster group
191            * @return the cluster group, or <code>null</code> if a cluster group with the primary key could not be found
192            * @throws SystemException if a system exception occurred
193            */
194            public static com.liferay.portal.model.ClusterGroup fetchByPrimaryKey(
195                    long clusterGroupId)
196                    throws com.liferay.portal.kernel.exception.SystemException {
197                    return getPersistence().fetchByPrimaryKey(clusterGroupId);
198            }
199    
200            /**
201            * Returns all the cluster groups.
202            *
203            * @return the cluster groups
204            * @throws SystemException if a system exception occurred
205            */
206            public static java.util.List<com.liferay.portal.model.ClusterGroup> findAll()
207                    throws com.liferay.portal.kernel.exception.SystemException {
208                    return getPersistence().findAll();
209            }
210    
211            /**
212            * Returns a range of all the cluster groups.
213            *
214            * <p>
215            * 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.
216            * </p>
217            *
218            * @param start the lower bound of the range of cluster groups
219            * @param end the upper bound of the range of cluster groups (not inclusive)
220            * @return the range of cluster groups
221            * @throws SystemException if a system exception occurred
222            */
223            public static java.util.List<com.liferay.portal.model.ClusterGroup> findAll(
224                    int start, int end)
225                    throws com.liferay.portal.kernel.exception.SystemException {
226                    return getPersistence().findAll(start, end);
227            }
228    
229            /**
230            * Returns an ordered range of all the cluster groups.
231            *
232            * <p>
233            * 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.
234            * </p>
235            *
236            * @param start the lower bound of the range of cluster groups
237            * @param end the upper bound of the range of cluster groups (not inclusive)
238            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
239            * @return the ordered range of cluster groups
240            * @throws SystemException if a system exception occurred
241            */
242            public static java.util.List<com.liferay.portal.model.ClusterGroup> findAll(
243                    int start, int end,
244                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
245                    throws com.liferay.portal.kernel.exception.SystemException {
246                    return getPersistence().findAll(start, end, orderByComparator);
247            }
248    
249            /**
250            * Removes all the cluster groups from the database.
251            *
252            * @throws SystemException if a system exception occurred
253            */
254            public static void removeAll()
255                    throws com.liferay.portal.kernel.exception.SystemException {
256                    getPersistence().removeAll();
257            }
258    
259            /**
260            * Returns the number of cluster groups.
261            *
262            * @return the number of cluster groups
263            * @throws SystemException if a system exception occurred
264            */
265            public static int countAll()
266                    throws com.liferay.portal.kernel.exception.SystemException {
267                    return getPersistence().countAll();
268            }
269    
270            public static ClusterGroupPersistence getPersistence() {
271                    if (_persistence == null) {
272                            _persistence = (ClusterGroupPersistence)PortalBeanLocatorUtil.locate(ClusterGroupPersistence.class.getName());
273    
274                            ReferenceRegistry.registerReference(ClusterGroupUtil.class,
275                                    "_persistence");
276                    }
277    
278                    return _persistence;
279            }
280    
281            public void setPersistence(ClusterGroupPersistence persistence) {
282                    _persistence = persistence;
283    
284                    ReferenceRegistry.registerReference(ClusterGroupUtil.class,
285                            "_persistence");
286            }
287    
288            private static ClusterGroupPersistence _persistence;
289    }