001    /**
002     * Copyright (c) 2000-2010 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.model.Release;
022    import com.liferay.portal.service.ServiceContext;
023    
024    import java.util.List;
025    
026    /**
027     * The persistence utility for the release service.
028     *
029     * <p>
030     * Never modify this class directly. Modify <code>service.xml</code> and rerun ServiceBuilder to regnerate this class.
031     * </p>
032     *
033     * @author Brian Wing Shun Chan
034     * @see ReleasePersistence
035     * @see ReleasePersistenceImpl
036     * @generated
037     */
038    public class ReleaseUtil {
039            /**
040             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache()
041             */
042            public static void clearCache() {
043                    getPersistence().clearCache();
044            }
045    
046            /**
047             * @see com.liferay.portal.service.persistence.BasePersistence#clearCache(com.liferay.portal.model.BaseModel)
048             */
049            public static void clearCache(Release release) {
050                    getPersistence().clearCache(release);
051            }
052    
053            /**
054             * @see com.liferay.portal.service.persistence.BasePersistence#countWithDynamicQuery(DynamicQuery)
055             */
056            public long countWithDynamicQuery(DynamicQuery dynamicQuery)
057                    throws SystemException {
058                    return getPersistence().countWithDynamicQuery(dynamicQuery);
059            }
060    
061            /**
062             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery)
063             */
064            public static List<Release> findWithDynamicQuery(DynamicQuery dynamicQuery)
065                    throws SystemException {
066                    return getPersistence().findWithDynamicQuery(dynamicQuery);
067            }
068    
069            /**
070             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int)
071             */
072            public static List<Release> findWithDynamicQuery(
073                    DynamicQuery dynamicQuery, int start, int end)
074                    throws SystemException {
075                    return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
076            }
077    
078            /**
079             * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator)
080             */
081            public static List<Release> findWithDynamicQuery(
082                    DynamicQuery dynamicQuery, int start, int end,
083                    OrderByComparator orderByComparator) throws SystemException {
084                    return getPersistence()
085                                       .findWithDynamicQuery(dynamicQuery, start, end,
086                            orderByComparator);
087            }
088    
089            /**
090             * @see com.liferay.portal.service.persistence.BasePersistence#remove(com.liferay.portal.model.BaseModel)
091             */
092            public static Release remove(Release release) throws SystemException {
093                    return getPersistence().remove(release);
094            }
095    
096            /**
097             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean)
098             */
099            public static Release update(Release release, boolean merge)
100                    throws SystemException {
101                    return getPersistence().update(release, merge);
102            }
103    
104            /**
105             * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean, ServiceContext)
106             */
107            public static Release update(Release release, boolean merge,
108                    ServiceContext serviceContext) throws SystemException {
109                    return getPersistence().update(release, merge, serviceContext);
110            }
111    
112            /**
113            * Caches the release in the entity cache if it is enabled.
114            *
115            * @param release the release to cache
116            */
117            public static void cacheResult(com.liferay.portal.model.Release release) {
118                    getPersistence().cacheResult(release);
119            }
120    
121            /**
122            * Caches the releases in the entity cache if it is enabled.
123            *
124            * @param releases the releases to cache
125            */
126            public static void cacheResult(
127                    java.util.List<com.liferay.portal.model.Release> releases) {
128                    getPersistence().cacheResult(releases);
129            }
130    
131            /**
132            * Creates a new release with the primary key.
133            *
134            * @param releaseId the primary key for the new release
135            * @return the new release
136            */
137            public static com.liferay.portal.model.Release create(long releaseId) {
138                    return getPersistence().create(releaseId);
139            }
140    
141            /**
142            * Removes the release with the primary key from the database. Also notifies the appropriate model listeners.
143            *
144            * @param releaseId the primary key of the release to remove
145            * @return the release that was removed
146            * @throws com.liferay.portal.NoSuchReleaseException if a release with the primary key could not be found
147            * @throws SystemException if a system exception occurred
148            */
149            public static com.liferay.portal.model.Release remove(long releaseId)
150                    throws com.liferay.portal.NoSuchReleaseException,
151                            com.liferay.portal.kernel.exception.SystemException {
152                    return getPersistence().remove(releaseId);
153            }
154    
155            public static com.liferay.portal.model.Release updateImpl(
156                    com.liferay.portal.model.Release release, boolean merge)
157                    throws com.liferay.portal.kernel.exception.SystemException {
158                    return getPersistence().updateImpl(release, merge);
159            }
160    
161            /**
162            * Finds the release with the primary key or throws a {@link com.liferay.portal.NoSuchReleaseException} if it could not be found.
163            *
164            * @param releaseId the primary key of the release to find
165            * @return the release
166            * @throws com.liferay.portal.NoSuchReleaseException if a release with the primary key could not be found
167            * @throws SystemException if a system exception occurred
168            */
169            public static com.liferay.portal.model.Release findByPrimaryKey(
170                    long releaseId)
171                    throws com.liferay.portal.NoSuchReleaseException,
172                            com.liferay.portal.kernel.exception.SystemException {
173                    return getPersistence().findByPrimaryKey(releaseId);
174            }
175    
176            /**
177            * Finds the release with the primary key or returns <code>null</code> if it could not be found.
178            *
179            * @param releaseId the primary key of the release to find
180            * @return the release, or <code>null</code> if a release with the primary key could not be found
181            * @throws SystemException if a system exception occurred
182            */
183            public static com.liferay.portal.model.Release fetchByPrimaryKey(
184                    long releaseId)
185                    throws com.liferay.portal.kernel.exception.SystemException {
186                    return getPersistence().fetchByPrimaryKey(releaseId);
187            }
188    
189            /**
190            * Finds the release where servletContextName = &#63; or throws a {@link com.liferay.portal.NoSuchReleaseException} if it could not be found.
191            *
192            * @param servletContextName the servlet context name to search with
193            * @return the matching release
194            * @throws com.liferay.portal.NoSuchReleaseException if a matching release could not be found
195            * @throws SystemException if a system exception occurred
196            */
197            public static com.liferay.portal.model.Release findByServletContextName(
198                    java.lang.String servletContextName)
199                    throws com.liferay.portal.NoSuchReleaseException,
200                            com.liferay.portal.kernel.exception.SystemException {
201                    return getPersistence().findByServletContextName(servletContextName);
202            }
203    
204            /**
205            * Finds the release where servletContextName = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
206            *
207            * @param servletContextName the servlet context name to search with
208            * @return the matching release, or <code>null</code> if a matching release could not be found
209            * @throws SystemException if a system exception occurred
210            */
211            public static com.liferay.portal.model.Release fetchByServletContextName(
212                    java.lang.String servletContextName)
213                    throws com.liferay.portal.kernel.exception.SystemException {
214                    return getPersistence().fetchByServletContextName(servletContextName);
215            }
216    
217            /**
218            * Finds the release where servletContextName = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
219            *
220            * @param servletContextName the servlet context name to search with
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            * Finds 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            * Finds 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 to return
251            * @param end the upper bound of the range of releases to return (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            * Finds 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 to return
269            * @param end the upper bound of the range of releases to return (not inclusive)
270            * @param orderByComparator the comparator to order the results by
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 to search with
285            * @throws SystemException if a system exception occurred
286            */
287            public static void removeByServletContextName(
288                    java.lang.String servletContextName)
289                    throws com.liferay.portal.NoSuchReleaseException,
290                            com.liferay.portal.kernel.exception.SystemException {
291                    getPersistence().removeByServletContextName(servletContextName);
292            }
293    
294            /**
295            * Removes all the releases from the database.
296            *
297            * @throws SystemException if a system exception occurred
298            */
299            public static void removeAll()
300                    throws com.liferay.portal.kernel.exception.SystemException {
301                    getPersistence().removeAll();
302            }
303    
304            /**
305            * Counts all the releases where servletContextName = &#63;.
306            *
307            * @param servletContextName the servlet context name to search with
308            * @return the number of matching releases
309            * @throws SystemException if a system exception occurred
310            */
311            public static int countByServletContextName(
312                    java.lang.String servletContextName)
313                    throws com.liferay.portal.kernel.exception.SystemException {
314                    return getPersistence().countByServletContextName(servletContextName);
315            }
316    
317            /**
318            * Counts all the releases.
319            *
320            * @return the number of releases
321            * @throws SystemException if a system exception occurred
322            */
323            public static int countAll()
324                    throws com.liferay.portal.kernel.exception.SystemException {
325                    return getPersistence().countAll();
326            }
327    
328            public static ReleasePersistence getPersistence() {
329                    if (_persistence == null) {
330                            _persistence = (ReleasePersistence)PortalBeanLocatorUtil.locate(ReleasePersistence.class.getName());
331                    }
332    
333                    return _persistence;
334            }
335    
336            public void setPersistence(ReleasePersistence persistence) {
337                    _persistence = persistence;
338            }
339    
340            private static ReleasePersistence _persistence;
341    }