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