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