1   /**
2    * Copyright (c) 2000-2009 Liferay, Inc. All rights reserved.
3    *
4    *
5    *
6    *
7    * The contents of this file are subject to the terms of the Liferay Enterprise
8    * Subscription License ("License"). You may not use this file except in
9    * compliance with the License. You can obtain a copy of the License by
10   * contacting Liferay, Inc. See the License for the specific language governing
11   * permissions and limitations under the License, including but not limited to
12   * distribution rights 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  /**
27   * <a href="ResourceUtil.java.html"><b><i>View Source</i></b></a>
28   *
29   * <p>
30   * ServiceBuilder generated this class. Modifications in this class will be
31   * overwritten the next time is generated.
32   * </p>
33   *
34   * @author    Brian Wing Shun Chan
35   * @see       ResourcePersistence
36   * @see       ResourcePersistenceImpl
37   * @generated
38   */
39  public class ResourceUtil {
40      public static void cacheResult(com.liferay.portal.model.Resource resource) {
41          getPersistence().cacheResult(resource);
42      }
43  
44      public static void cacheResult(
45          java.util.List<com.liferay.portal.model.Resource> resources) {
46          getPersistence().cacheResult(resources);
47      }
48  
49      public static void clearCache() {
50          getPersistence().clearCache();
51      }
52  
53      public static com.liferay.portal.model.Resource create(long resourceId) {
54          return getPersistence().create(resourceId);
55      }
56  
57      public static com.liferay.portal.model.Resource remove(long resourceId)
58          throws com.liferay.portal.NoSuchResourceException,
59              com.liferay.portal.SystemException {
60          return getPersistence().remove(resourceId);
61      }
62  
63      public static com.liferay.portal.model.Resource remove(
64          com.liferay.portal.model.Resource resource)
65          throws com.liferay.portal.SystemException {
66          return getPersistence().remove(resource);
67      }
68  
69      /**
70       * @deprecated Use {@link #update(Resource, boolean merge)}.
71       */
72      public static com.liferay.portal.model.Resource update(
73          com.liferay.portal.model.Resource resource)
74          throws com.liferay.portal.SystemException {
75          return getPersistence().update(resource);
76      }
77  
78      /**
79       * Add, update, or merge, the entity. This method also calls the model
80       * listeners to trigger the proper events associated with adding, deleting,
81       * or updating an entity.
82       *
83       * @param  resource the entity to add, update, or merge
84       * @param  merge boolean value for whether to merge the entity. The default
85       *         value is false. Setting merge to true is more expensive and
86       *         should only be true when resource is transient. See
87       *         LEP-5473 for a detailed discussion of this method.
88       * @return the entity that was added, updated, or merged
89       */
90      public static com.liferay.portal.model.Resource update(
91          com.liferay.portal.model.Resource resource, boolean merge)
92          throws com.liferay.portal.SystemException {
93          return getPersistence().update(resource, merge);
94      }
95  
96      public static com.liferay.portal.model.Resource updateImpl(
97          com.liferay.portal.model.Resource resource, boolean merge)
98          throws com.liferay.portal.SystemException {
99          return getPersistence().updateImpl(resource, merge);
100     }
101 
102     public static com.liferay.portal.model.Resource findByPrimaryKey(
103         long resourceId)
104         throws com.liferay.portal.NoSuchResourceException,
105             com.liferay.portal.SystemException {
106         return getPersistence().findByPrimaryKey(resourceId);
107     }
108 
109     public static com.liferay.portal.model.Resource fetchByPrimaryKey(
110         long resourceId) throws com.liferay.portal.SystemException {
111         return getPersistence().fetchByPrimaryKey(resourceId);
112     }
113 
114     public static java.util.List<com.liferay.portal.model.Resource> findByCodeId(
115         long codeId) throws com.liferay.portal.SystemException {
116         return getPersistence().findByCodeId(codeId);
117     }
118 
119     public static java.util.List<com.liferay.portal.model.Resource> findByCodeId(
120         long codeId, int start, int end)
121         throws com.liferay.portal.SystemException {
122         return getPersistence().findByCodeId(codeId, start, end);
123     }
124 
125     public static java.util.List<com.liferay.portal.model.Resource> findByCodeId(
126         long codeId, int start, int end,
127         com.liferay.portal.kernel.util.OrderByComparator obc)
128         throws com.liferay.portal.SystemException {
129         return getPersistence().findByCodeId(codeId, start, end, obc);
130     }
131 
132     public static com.liferay.portal.model.Resource findByCodeId_First(
133         long codeId, com.liferay.portal.kernel.util.OrderByComparator obc)
134         throws com.liferay.portal.NoSuchResourceException,
135             com.liferay.portal.SystemException {
136         return getPersistence().findByCodeId_First(codeId, obc);
137     }
138 
139     public static com.liferay.portal.model.Resource findByCodeId_Last(
140         long codeId, com.liferay.portal.kernel.util.OrderByComparator obc)
141         throws com.liferay.portal.NoSuchResourceException,
142             com.liferay.portal.SystemException {
143         return getPersistence().findByCodeId_Last(codeId, obc);
144     }
145 
146     public static com.liferay.portal.model.Resource[] findByCodeId_PrevAndNext(
147         long resourceId, long codeId,
148         com.liferay.portal.kernel.util.OrderByComparator obc)
149         throws com.liferay.portal.NoSuchResourceException,
150             com.liferay.portal.SystemException {
151         return getPersistence().findByCodeId_PrevAndNext(resourceId, codeId, obc);
152     }
153 
154     public static com.liferay.portal.model.Resource findByC_P(long codeId,
155         java.lang.String primKey)
156         throws com.liferay.portal.NoSuchResourceException,
157             com.liferay.portal.SystemException {
158         return getPersistence().findByC_P(codeId, primKey);
159     }
160 
161     public static com.liferay.portal.model.Resource fetchByC_P(long codeId,
162         java.lang.String primKey) throws com.liferay.portal.SystemException {
163         return getPersistence().fetchByC_P(codeId, primKey);
164     }
165 
166     public static com.liferay.portal.model.Resource fetchByC_P(long codeId,
167         java.lang.String primKey, boolean retrieveFromCache)
168         throws com.liferay.portal.SystemException {
169         return getPersistence().fetchByC_P(codeId, primKey, retrieveFromCache);
170     }
171 
172     public static java.util.List<Object> findWithDynamicQuery(
173         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
174         throws com.liferay.portal.SystemException {
175         return getPersistence().findWithDynamicQuery(dynamicQuery);
176     }
177 
178     public static java.util.List<Object> findWithDynamicQuery(
179         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
180         int end) throws com.liferay.portal.SystemException {
181         return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
182     }
183 
184     public static java.util.List<com.liferay.portal.model.Resource> findAll()
185         throws com.liferay.portal.SystemException {
186         return getPersistence().findAll();
187     }
188 
189     public static java.util.List<com.liferay.portal.model.Resource> findAll(
190         int start, int end) throws com.liferay.portal.SystemException {
191         return getPersistence().findAll(start, end);
192     }
193 
194     public static java.util.List<com.liferay.portal.model.Resource> findAll(
195         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
196         throws com.liferay.portal.SystemException {
197         return getPersistence().findAll(start, end, obc);
198     }
199 
200     public static void removeByCodeId(long codeId)
201         throws com.liferay.portal.SystemException {
202         getPersistence().removeByCodeId(codeId);
203     }
204 
205     public static void removeByC_P(long codeId, java.lang.String primKey)
206         throws com.liferay.portal.NoSuchResourceException,
207             com.liferay.portal.SystemException {
208         getPersistence().removeByC_P(codeId, primKey);
209     }
210 
211     public static void removeAll() throws com.liferay.portal.SystemException {
212         getPersistence().removeAll();
213     }
214 
215     public static int countByCodeId(long codeId)
216         throws com.liferay.portal.SystemException {
217         return getPersistence().countByCodeId(codeId);
218     }
219 
220     public static int countByC_P(long codeId, java.lang.String primKey)
221         throws com.liferay.portal.SystemException {
222         return getPersistence().countByC_P(codeId, primKey);
223     }
224 
225     public static int countAll() throws com.liferay.portal.SystemException {
226         return getPersistence().countAll();
227     }
228 
229     public static ResourcePersistence getPersistence() {
230         return _persistence;
231     }
232 
233     public void setPersistence(ResourcePersistence persistence) {
234         _persistence = persistence;
235     }
236 
237     private static ResourcePersistence _persistence;
238 }