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