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.Release;
024    import com.liferay.portal.service.ServiceContext;
025    
026    import java.util.List;
027    
028    /**
029     * The persistence utility for the release service. This utility wraps {@link ReleasePersistenceImpl} 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 ReleasePersistence
037     * @see ReleasePersistenceImpl
038     * @generated
039     */
040    @ProviderType
041    public class ReleaseUtil {
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(Release release) {
059                    getPersistence().clearCache(release);
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<Release> findWithDynamicQuery(DynamicQuery dynamicQuery) {
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<Release> findWithDynamicQuery(
080                    DynamicQuery dynamicQuery, int start, int end) {
081                    return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
082            }
083    
084            /**
085             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator)
086             */
087            public static List<Release> findWithDynamicQuery(
088                    DynamicQuery dynamicQuery, int start, int end,
089                    OrderByComparator<Release> orderByComparator) {
090                    return getPersistence()
091                                       .findWithDynamicQuery(dynamicQuery, start, end,
092                            orderByComparator);
093            }
094    
095            /**
096             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel)
097             */
098            public static Release update(Release release) {
099                    return getPersistence().update(release);
100            }
101    
102            /**
103             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, ServiceContext)
104             */
105            public static Release update(Release release, ServiceContext serviceContext) {
106                    return getPersistence().update(release, serviceContext);
107            }
108    
109            /**
110            * Returns the release where servletContextName = &#63; or throws a {@link com.liferay.portal.NoSuchReleaseException} if it could not be found.
111            *
112            * @param servletContextName the servlet context name
113            * @return the matching release
114            * @throws com.liferay.portal.NoSuchReleaseException if a matching release could not be found
115            */
116            public static com.liferay.portal.model.Release findByServletContextName(
117                    java.lang.String servletContextName)
118                    throws com.liferay.portal.NoSuchReleaseException {
119                    return getPersistence().findByServletContextName(servletContextName);
120            }
121    
122            /**
123            * Returns the release where servletContextName = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
124            *
125            * @param servletContextName the servlet context name
126            * @return the matching release, or <code>null</code> if a matching release could not be found
127            */
128            public static com.liferay.portal.model.Release fetchByServletContextName(
129                    java.lang.String servletContextName) {
130                    return getPersistence().fetchByServletContextName(servletContextName);
131            }
132    
133            /**
134            * Returns the release where servletContextName = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
135            *
136            * @param servletContextName the servlet context name
137            * @param retrieveFromCache whether to use the finder cache
138            * @return the matching release, or <code>null</code> if a matching release could not be found
139            */
140            public static com.liferay.portal.model.Release fetchByServletContextName(
141                    java.lang.String servletContextName, boolean retrieveFromCache) {
142                    return getPersistence()
143                                       .fetchByServletContextName(servletContextName,
144                            retrieveFromCache);
145            }
146    
147            /**
148            * Removes the release where servletContextName = &#63; from the database.
149            *
150            * @param servletContextName the servlet context name
151            * @return the release that was removed
152            */
153            public static com.liferay.portal.model.Release removeByServletContextName(
154                    java.lang.String servletContextName)
155                    throws com.liferay.portal.NoSuchReleaseException {
156                    return getPersistence().removeByServletContextName(servletContextName);
157            }
158    
159            /**
160            * Returns the number of releases where servletContextName = &#63;.
161            *
162            * @param servletContextName the servlet context name
163            * @return the number of matching releases
164            */
165            public static int countByServletContextName(
166                    java.lang.String servletContextName) {
167                    return getPersistence().countByServletContextName(servletContextName);
168            }
169    
170            /**
171            * Caches the release in the entity cache if it is enabled.
172            *
173            * @param release the release
174            */
175            public static void cacheResult(com.liferay.portal.model.Release release) {
176                    getPersistence().cacheResult(release);
177            }
178    
179            /**
180            * Caches the releases in the entity cache if it is enabled.
181            *
182            * @param releases the releases
183            */
184            public static void cacheResult(
185                    java.util.List<com.liferay.portal.model.Release> releases) {
186                    getPersistence().cacheResult(releases);
187            }
188    
189            /**
190            * Creates a new release with the primary key. Does not add the release to the database.
191            *
192            * @param releaseId the primary key for the new release
193            * @return the new release
194            */
195            public static com.liferay.portal.model.Release create(long releaseId) {
196                    return getPersistence().create(releaseId);
197            }
198    
199            /**
200            * Removes the release with the primary key from the database. Also notifies the appropriate model listeners.
201            *
202            * @param releaseId the primary key of the release
203            * @return the release that was removed
204            * @throws com.liferay.portal.NoSuchReleaseException if a release with the primary key could not be found
205            */
206            public static com.liferay.portal.model.Release remove(long releaseId)
207                    throws com.liferay.portal.NoSuchReleaseException {
208                    return getPersistence().remove(releaseId);
209            }
210    
211            public static com.liferay.portal.model.Release updateImpl(
212                    com.liferay.portal.model.Release release) {
213                    return getPersistence().updateImpl(release);
214            }
215    
216            /**
217            * Returns the release with the primary key or throws a {@link com.liferay.portal.NoSuchReleaseException} if it could not be found.
218            *
219            * @param releaseId the primary key of the release
220            * @return the release
221            * @throws com.liferay.portal.NoSuchReleaseException if a release with the primary key could not be found
222            */
223            public static com.liferay.portal.model.Release findByPrimaryKey(
224                    long releaseId) throws com.liferay.portal.NoSuchReleaseException {
225                    return getPersistence().findByPrimaryKey(releaseId);
226            }
227    
228            /**
229            * Returns the release with the primary key or returns <code>null</code> if it could not be found.
230            *
231            * @param releaseId the primary key of the release
232            * @return the release, or <code>null</code> if a release with the primary key could not be found
233            */
234            public static com.liferay.portal.model.Release fetchByPrimaryKey(
235                    long releaseId) {
236                    return getPersistence().fetchByPrimaryKey(releaseId);
237            }
238    
239            public static java.util.Map<java.io.Serializable, com.liferay.portal.model.Release> fetchByPrimaryKeys(
240                    java.util.Set<java.io.Serializable> primaryKeys) {
241                    return getPersistence().fetchByPrimaryKeys(primaryKeys);
242            }
243    
244            /**
245            * Returns all the releases.
246            *
247            * @return the releases
248            */
249            public static java.util.List<com.liferay.portal.model.Release> findAll() {
250                    return getPersistence().findAll();
251            }
252    
253            /**
254            * Returns a range of all the releases.
255            *
256            * <p>
257            * 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.ReleaseModelImpl}. 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.
258            * </p>
259            *
260            * @param start the lower bound of the range of releases
261            * @param end the upper bound of the range of releases (not inclusive)
262            * @return the range of releases
263            */
264            public static java.util.List<com.liferay.portal.model.Release> findAll(
265                    int start, int end) {
266                    return getPersistence().findAll(start, end);
267            }
268    
269            /**
270            * Returns an ordered range of all the releases.
271            *
272            * <p>
273            * 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.ReleaseModelImpl}. 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.
274            * </p>
275            *
276            * @param start the lower bound of the range of releases
277            * @param end the upper bound of the range of releases (not inclusive)
278            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
279            * @return the ordered range of releases
280            */
281            public static java.util.List<com.liferay.portal.model.Release> findAll(
282                    int start, int end,
283                    com.liferay.portal.kernel.util.OrderByComparator<com.liferay.portal.model.Release> orderByComparator) {
284                    return getPersistence().findAll(start, end, orderByComparator);
285            }
286    
287            /**
288            * Removes all the releases from the database.
289            */
290            public static void removeAll() {
291                    getPersistence().removeAll();
292            }
293    
294            /**
295            * Returns the number of releases.
296            *
297            * @return the number of releases
298            */
299            public static int countAll() {
300                    return getPersistence().countAll();
301            }
302    
303            public static ReleasePersistence getPersistence() {
304                    if (_persistence == null) {
305                            _persistence = (ReleasePersistence)PortalBeanLocatorUtil.locate(ReleasePersistence.class.getName());
306    
307                            ReferenceRegistry.registerReference(ReleaseUtil.class,
308                                    "_persistence");
309                    }
310    
311                    return _persistence;
312            }
313    
314            /**
315             * @deprecated As of 6.2.0
316             */
317            @Deprecated
318            public void setPersistence(ReleasePersistence persistence) {
319            }
320    
321            private static ReleasePersistence _persistence;
322    }