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