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.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#update(com.liferay.portal.model.BaseModel)
098             */
099            public static ClusterGroup update(ClusterGroup clusterGroup)
100                    throws SystemException {
101                    return getPersistence().update(clusterGroup);
102            }
103    
104            /**
105             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, ServiceContext)
106             */
107            public static ClusterGroup update(ClusterGroup clusterGroup,
108                    ServiceContext serviceContext) throws SystemException {
109                    return getPersistence().update(clusterGroup, serviceContext);
110            }
111    
112            /**
113            * Caches the cluster group in the entity cache if it is enabled.
114            *
115            * @param clusterGroup the cluster group
116            */
117            public static void cacheResult(
118                    com.liferay.portal.model.ClusterGroup clusterGroup) {
119                    getPersistence().cacheResult(clusterGroup);
120            }
121    
122            /**
123            * Caches the cluster groups in the entity cache if it is enabled.
124            *
125            * @param clusterGroups the cluster groups
126            */
127            public static void cacheResult(
128                    java.util.List<com.liferay.portal.model.ClusterGroup> clusterGroups) {
129                    getPersistence().cacheResult(clusterGroups);
130            }
131    
132            /**
133            * Creates a new cluster group with the primary key. Does not add the cluster group to the database.
134            *
135            * @param clusterGroupId the primary key for the new cluster group
136            * @return the new cluster group
137            */
138            public static com.liferay.portal.model.ClusterGroup create(
139                    long clusterGroupId) {
140                    return getPersistence().create(clusterGroupId);
141            }
142    
143            /**
144            * Removes the cluster group with the primary key from the database. Also notifies the appropriate model listeners.
145            *
146            * @param clusterGroupId the primary key of the cluster group
147            * @return the cluster group that was removed
148            * @throws com.liferay.portal.NoSuchClusterGroupException if a cluster group with the primary key could not be found
149            * @throws SystemException if a system exception occurred
150            */
151            public static com.liferay.portal.model.ClusterGroup remove(
152                    long clusterGroupId)
153                    throws com.liferay.portal.NoSuchClusterGroupException,
154                            com.liferay.portal.kernel.exception.SystemException {
155                    return getPersistence().remove(clusterGroupId);
156            }
157    
158            public static com.liferay.portal.model.ClusterGroup updateImpl(
159                    com.liferay.portal.model.ClusterGroup clusterGroup)
160                    throws com.liferay.portal.kernel.exception.SystemException {
161                    return getPersistence().updateImpl(clusterGroup);
162            }
163    
164            /**
165            * Returns the cluster group with the primary key or throws a {@link com.liferay.portal.NoSuchClusterGroupException} if it could not be found.
166            *
167            * @param clusterGroupId the primary key of the cluster group
168            * @return the cluster group
169            * @throws com.liferay.portal.NoSuchClusterGroupException if a cluster group with the primary key could not be found
170            * @throws SystemException if a system exception occurred
171            */
172            public static com.liferay.portal.model.ClusterGroup findByPrimaryKey(
173                    long clusterGroupId)
174                    throws com.liferay.portal.NoSuchClusterGroupException,
175                            com.liferay.portal.kernel.exception.SystemException {
176                    return getPersistence().findByPrimaryKey(clusterGroupId);
177            }
178    
179            /**
180            * Returns the cluster group with the primary key or returns <code>null</code> if it could not be found.
181            *
182            * @param clusterGroupId the primary key of the cluster group
183            * @return the cluster group, or <code>null</code> if a cluster group with the primary key could not be found
184            * @throws SystemException if a system exception occurred
185            */
186            public static com.liferay.portal.model.ClusterGroup fetchByPrimaryKey(
187                    long clusterGroupId)
188                    throws com.liferay.portal.kernel.exception.SystemException {
189                    return getPersistence().fetchByPrimaryKey(clusterGroupId);
190            }
191    
192            /**
193            * Returns all the cluster groups.
194            *
195            * @return the cluster groups
196            * @throws SystemException if a system exception occurred
197            */
198            public static java.util.List<com.liferay.portal.model.ClusterGroup> findAll()
199                    throws com.liferay.portal.kernel.exception.SystemException {
200                    return getPersistence().findAll();
201            }
202    
203            /**
204            * Returns a range of all the cluster groups.
205            *
206            * <p>
207            * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.ClusterGroupModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
208            * </p>
209            *
210            * @param start the lower bound of the range of cluster groups
211            * @param end the upper bound of the range of cluster groups (not inclusive)
212            * @return the range of cluster groups
213            * @throws SystemException if a system exception occurred
214            */
215            public static java.util.List<com.liferay.portal.model.ClusterGroup> findAll(
216                    int start, int end)
217                    throws com.liferay.portal.kernel.exception.SystemException {
218                    return getPersistence().findAll(start, end);
219            }
220    
221            /**
222            * Returns an ordered range of all the cluster groups.
223            *
224            * <p>
225            * 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. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.ClusterGroupModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
226            * </p>
227            *
228            * @param start the lower bound of the range of cluster groups
229            * @param end the upper bound of the range of cluster groups (not inclusive)
230            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
231            * @return the ordered range of cluster groups
232            * @throws SystemException if a system exception occurred
233            */
234            public static java.util.List<com.liferay.portal.model.ClusterGroup> findAll(
235                    int start, int end,
236                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
237                    throws com.liferay.portal.kernel.exception.SystemException {
238                    return getPersistence().findAll(start, end, orderByComparator);
239            }
240    
241            /**
242            * Removes all the cluster groups from the database.
243            *
244            * @throws SystemException if a system exception occurred
245            */
246            public static void removeAll()
247                    throws com.liferay.portal.kernel.exception.SystemException {
248                    getPersistence().removeAll();
249            }
250    
251            /**
252            * Returns the number of cluster groups.
253            *
254            * @return the number of cluster groups
255            * @throws SystemException if a system exception occurred
256            */
257            public static int countAll()
258                    throws com.liferay.portal.kernel.exception.SystemException {
259                    return getPersistence().countAll();
260            }
261    
262            public static ClusterGroupPersistence getPersistence() {
263                    if (_persistence == null) {
264                            _persistence = (ClusterGroupPersistence)PortalBeanLocatorUtil.locate(ClusterGroupPersistence.class.getName());
265    
266                            ReferenceRegistry.registerReference(ClusterGroupUtil.class,
267                                    "_persistence");
268                    }
269    
270                    return _persistence;
271            }
272    
273            /**
274             * @deprecated
275             */
276            public void setPersistence(ClusterGroupPersistence persistence) {
277            }
278    
279            private static ClusterGroupPersistence _persistence;
280    }