1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    * The contents of this file are subject to the terms of the Liferay Enterprise
5    * Subscription License ("License"). You may not use this file except in
6    * compliance with the License. You can obtain a copy of the License by
7    * contacting Liferay, Inc. See the License for the specific language governing
8    * permissions and limitations under the License, including but not limited to
9    * distribution rights of the Software.
10   *
11   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
14   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
15   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
16   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
17   * SOFTWARE.
18   */
19  
20  package com.liferay.portal.service.persistence;
21  
22  /**
23   * <a href="ReleaseUtil.java.html"><b><i>View Source</i></b></a>
24   *
25   * @author Brian Wing Shun Chan
26   *
27   */
28  public class ReleaseUtil {
29      public static void cacheResult(com.liferay.portal.model.Release release) {
30          getPersistence().cacheResult(release);
31      }
32  
33      public static void cacheResult(
34          java.util.List<com.liferay.portal.model.Release> releases) {
35          getPersistence().cacheResult(releases);
36      }
37  
38      public static void clearCache() {
39          getPersistence().clearCache();
40      }
41  
42      public static com.liferay.portal.model.Release create(long releaseId) {
43          return getPersistence().create(releaseId);
44      }
45  
46      public static com.liferay.portal.model.Release remove(long releaseId)
47          throws com.liferay.portal.NoSuchReleaseException,
48              com.liferay.portal.SystemException {
49          return getPersistence().remove(releaseId);
50      }
51  
52      public static com.liferay.portal.model.Release remove(
53          com.liferay.portal.model.Release release)
54          throws com.liferay.portal.SystemException {
55          return getPersistence().remove(release);
56      }
57  
58      /**
59       * @deprecated Use <code>update(Release release, boolean merge)</code>.
60       */
61      public static com.liferay.portal.model.Release update(
62          com.liferay.portal.model.Release release)
63          throws com.liferay.portal.SystemException {
64          return getPersistence().update(release);
65      }
66  
67      /**
68       * Add, update, or merge, the entity. This method also calls the model
69       * listeners to trigger the proper events associated with adding, deleting,
70       * or updating an entity.
71       *
72       * @param        release the entity to add, update, or merge
73       * @param        merge boolean value for whether to merge the entity. The
74       *                default value is false. Setting merge to true is more
75       *                expensive and should only be true when release is
76       *                transient. See LEP-5473 for a detailed discussion of this
77       *                method.
78       * @return        true if the portlet can be displayed via Ajax
79       */
80      public static com.liferay.portal.model.Release update(
81          com.liferay.portal.model.Release release, boolean merge)
82          throws com.liferay.portal.SystemException {
83          return getPersistence().update(release, merge);
84      }
85  
86      public static com.liferay.portal.model.Release updateImpl(
87          com.liferay.portal.model.Release release, boolean merge)
88          throws com.liferay.portal.SystemException {
89          return getPersistence().updateImpl(release, merge);
90      }
91  
92      public static com.liferay.portal.model.Release findByPrimaryKey(
93          long releaseId)
94          throws com.liferay.portal.NoSuchReleaseException,
95              com.liferay.portal.SystemException {
96          return getPersistence().findByPrimaryKey(releaseId);
97      }
98  
99      public static com.liferay.portal.model.Release fetchByPrimaryKey(
100         long releaseId) throws com.liferay.portal.SystemException {
101         return getPersistence().fetchByPrimaryKey(releaseId);
102     }
103 
104     public static java.util.List<Object> findWithDynamicQuery(
105         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
106         throws com.liferay.portal.SystemException {
107         return getPersistence().findWithDynamicQuery(dynamicQuery);
108     }
109 
110     public static java.util.List<Object> findWithDynamicQuery(
111         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
112         int end) throws com.liferay.portal.SystemException {
113         return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
114     }
115 
116     public static java.util.List<com.liferay.portal.model.Release> findAll()
117         throws com.liferay.portal.SystemException {
118         return getPersistence().findAll();
119     }
120 
121     public static java.util.List<com.liferay.portal.model.Release> findAll(
122         int start, int end) throws com.liferay.portal.SystemException {
123         return getPersistence().findAll(start, end);
124     }
125 
126     public static java.util.List<com.liferay.portal.model.Release> findAll(
127         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
128         throws com.liferay.portal.SystemException {
129         return getPersistence().findAll(start, end, obc);
130     }
131 
132     public static void removeAll() throws com.liferay.portal.SystemException {
133         getPersistence().removeAll();
134     }
135 
136     public static int countAll() throws com.liferay.portal.SystemException {
137         return getPersistence().countAll();
138     }
139 
140     public static ReleasePersistence getPersistence() {
141         return _persistence;
142     }
143 
144     public void setPersistence(ReleasePersistence persistence) {
145         _persistence = persistence;
146     }
147 
148     private static ReleasePersistence _persistence;
149 }