1   /**
2    * Copyright (c) 2000-2008 Liferay, Inc. All rights reserved.
3    *
4    * Permission is hereby granted, free of charge, to any person obtaining a copy
5    * of this software and associated documentation files (the "Software"), to deal
6    * in the Software without restriction, including without limitation the rights
7    * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
8    * copies of the Software, and to permit persons to whom the Software is
9    * furnished to do so, subject to the following conditions:
10   *
11   * The above copyright notice and this permission notice shall be included in
12   * all copies or substantial portions of the Software.
13   *
14   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
17   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
19   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
20   * SOFTWARE.
21   */
22  
23  package com.liferay.portal.service.persistence;
24  
25  /**
26   * <a href="ReleaseUtil.java.html"><b><i>View Source</i></b></a>
27   *
28   * @author Brian Wing Shun Chan
29   *
30   */
31  public class ReleaseUtil {
32      public static com.liferay.portal.model.Release create(long releaseId) {
33          return getPersistence().create(releaseId);
34      }
35  
36      public static com.liferay.portal.model.Release remove(long releaseId)
37          throws com.liferay.portal.NoSuchReleaseException,
38              com.liferay.portal.SystemException {
39          return getPersistence().remove(releaseId);
40      }
41  
42      public static com.liferay.portal.model.Release remove(
43          com.liferay.portal.model.Release release)
44          throws com.liferay.portal.SystemException {
45          return getPersistence().remove(release);
46      }
47  
48      /**
49       * @deprecated Use <code>update(Release release, boolean merge)</code>.
50       */
51      public static com.liferay.portal.model.Release update(
52          com.liferay.portal.model.Release release)
53          throws com.liferay.portal.SystemException {
54          return getPersistence().update(release);
55      }
56  
57      /**
58       * Add, update, or merge, the entity. This method also calls the model
59       * listeners to trigger the proper events associated with adding, deleting,
60       * or updating an entity.
61       *
62       * @param        release the entity to add, update, or merge
63       * @param        merge boolean value for whether to merge the entity. The
64       *                default value is false. Setting merge to true is more
65       *                expensive and should only be true when release is
66       *                transient. See LEP-5473 for a detailed discussion of this
67       *                method.
68       * @return        true if the portlet can be displayed via Ajax
69       */
70      public static com.liferay.portal.model.Release update(
71          com.liferay.portal.model.Release release, boolean merge)
72          throws com.liferay.portal.SystemException {
73          return getPersistence().update(release, merge);
74      }
75  
76      public static com.liferay.portal.model.Release updateImpl(
77          com.liferay.portal.model.Release release, boolean merge)
78          throws com.liferay.portal.SystemException {
79          return getPersistence().updateImpl(release, merge);
80      }
81  
82      public static com.liferay.portal.model.Release findByPrimaryKey(
83          long releaseId)
84          throws com.liferay.portal.NoSuchReleaseException,
85              com.liferay.portal.SystemException {
86          return getPersistence().findByPrimaryKey(releaseId);
87      }
88  
89      public static com.liferay.portal.model.Release fetchByPrimaryKey(
90          long releaseId) throws com.liferay.portal.SystemException {
91          return getPersistence().fetchByPrimaryKey(releaseId);
92      }
93  
94      public static java.util.List<com.liferay.portal.model.Release> findWithDynamicQuery(
95          com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer)
96          throws com.liferay.portal.SystemException {
97          return getPersistence().findWithDynamicQuery(queryInitializer);
98      }
99  
100     public static java.util.List<com.liferay.portal.model.Release> findWithDynamicQuery(
101         com.liferay.portal.kernel.dao.DynamicQueryInitializer queryInitializer,
102         int begin, int end) throws com.liferay.portal.SystemException {
103         return getPersistence()
104                    .findWithDynamicQuery(queryInitializer, begin, end);
105     }
106 
107     public static java.util.List<com.liferay.portal.model.Release> findAll()
108         throws com.liferay.portal.SystemException {
109         return getPersistence().findAll();
110     }
111 
112     public static java.util.List<com.liferay.portal.model.Release> findAll(
113         int begin, int end) throws com.liferay.portal.SystemException {
114         return getPersistence().findAll(begin, end);
115     }
116 
117     public static java.util.List<com.liferay.portal.model.Release> findAll(
118         int begin, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
119         throws com.liferay.portal.SystemException {
120         return getPersistence().findAll(begin, end, obc);
121     }
122 
123     public static void removeAll() throws com.liferay.portal.SystemException {
124         getPersistence().removeAll();
125     }
126 
127     public static int countAll() throws com.liferay.portal.SystemException {
128         return getPersistence().countAll();
129     }
130 
131     public static ReleasePersistence getPersistence() {
132         return _getUtil()._persistence;
133     }
134 
135     public void setPersistence(ReleasePersistence persistence) {
136         _persistence = persistence;
137     }
138 
139     private static ReleaseUtil _getUtil() {
140         if (_util == null) {
141             _util = (ReleaseUtil)com.liferay.portal.kernel.bean.BeanLocatorUtil.locate(_UTIL);
142         }
143 
144         return _util;
145     }
146 
147     private static final String _UTIL = ReleaseUtil.class.getName();
148     private static ReleaseUtil _util;
149     private ReleasePersistence _persistence;
150 }