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="ResourceCodeUtil.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       ResourceCodePersistence
36   * @see       ResourceCodePersistenceImpl
37   * @generated
38   */
39  public class ResourceCodeUtil {
40      public static void cacheResult(
41          com.liferay.portal.model.ResourceCode resourceCode) {
42          getPersistence().cacheResult(resourceCode);
43      }
44  
45      public static void cacheResult(
46          java.util.List<com.liferay.portal.model.ResourceCode> resourceCodes) {
47          getPersistence().cacheResult(resourceCodes);
48      }
49  
50      public static void clearCache() {
51          getPersistence().clearCache();
52      }
53  
54      public static com.liferay.portal.model.ResourceCode create(long codeId) {
55          return getPersistence().create(codeId);
56      }
57  
58      public static com.liferay.portal.model.ResourceCode remove(long codeId)
59          throws com.liferay.portal.NoSuchResourceCodeException,
60              com.liferay.portal.SystemException {
61          return getPersistence().remove(codeId);
62      }
63  
64      public static com.liferay.portal.model.ResourceCode remove(
65          com.liferay.portal.model.ResourceCode resourceCode)
66          throws com.liferay.portal.SystemException {
67          return getPersistence().remove(resourceCode);
68      }
69  
70      /**
71       * @deprecated Use {@link #update(ResourceCode, boolean merge)}.
72       */
73      public static com.liferay.portal.model.ResourceCode update(
74          com.liferay.portal.model.ResourceCode resourceCode)
75          throws com.liferay.portal.SystemException {
76          return getPersistence().update(resourceCode);
77      }
78  
79      /**
80       * Add, update, or merge, the entity. This method also calls the model
81       * listeners to trigger the proper events associated with adding, deleting,
82       * or updating an entity.
83       *
84       * @param  resourceCode the entity to add, update, or merge
85       * @param  merge boolean value for whether to merge the entity. The default
86       *         value is false. Setting merge to true is more expensive and
87       *         should only be true when resourceCode is transient. See
88       *         LEP-5473 for a detailed discussion of this method.
89       * @return the entity that was added, updated, or merged
90       */
91      public static com.liferay.portal.model.ResourceCode update(
92          com.liferay.portal.model.ResourceCode resourceCode, boolean merge)
93          throws com.liferay.portal.SystemException {
94          return getPersistence().update(resourceCode, merge);
95      }
96  
97      public static com.liferay.portal.model.ResourceCode updateImpl(
98          com.liferay.portal.model.ResourceCode resourceCode, boolean merge)
99          throws com.liferay.portal.SystemException {
100         return getPersistence().updateImpl(resourceCode, merge);
101     }
102 
103     public static com.liferay.portal.model.ResourceCode findByPrimaryKey(
104         long codeId)
105         throws com.liferay.portal.NoSuchResourceCodeException,
106             com.liferay.portal.SystemException {
107         return getPersistence().findByPrimaryKey(codeId);
108     }
109 
110     public static com.liferay.portal.model.ResourceCode fetchByPrimaryKey(
111         long codeId) throws com.liferay.portal.SystemException {
112         return getPersistence().fetchByPrimaryKey(codeId);
113     }
114 
115     public static java.util.List<com.liferay.portal.model.ResourceCode> findByCompanyId(
116         long companyId) throws com.liferay.portal.SystemException {
117         return getPersistence().findByCompanyId(companyId);
118     }
119 
120     public static java.util.List<com.liferay.portal.model.ResourceCode> findByCompanyId(
121         long companyId, int start, int end)
122         throws com.liferay.portal.SystemException {
123         return getPersistence().findByCompanyId(companyId, start, end);
124     }
125 
126     public static java.util.List<com.liferay.portal.model.ResourceCode> findByCompanyId(
127         long companyId, int start, int end,
128         com.liferay.portal.kernel.util.OrderByComparator obc)
129         throws com.liferay.portal.SystemException {
130         return getPersistence().findByCompanyId(companyId, start, end, obc);
131     }
132 
133     public static com.liferay.portal.model.ResourceCode findByCompanyId_First(
134         long companyId, com.liferay.portal.kernel.util.OrderByComparator obc)
135         throws com.liferay.portal.NoSuchResourceCodeException,
136             com.liferay.portal.SystemException {
137         return getPersistence().findByCompanyId_First(companyId, obc);
138     }
139 
140     public static com.liferay.portal.model.ResourceCode findByCompanyId_Last(
141         long companyId, com.liferay.portal.kernel.util.OrderByComparator obc)
142         throws com.liferay.portal.NoSuchResourceCodeException,
143             com.liferay.portal.SystemException {
144         return getPersistence().findByCompanyId_Last(companyId, obc);
145     }
146 
147     public static com.liferay.portal.model.ResourceCode[] findByCompanyId_PrevAndNext(
148         long codeId, long companyId,
149         com.liferay.portal.kernel.util.OrderByComparator obc)
150         throws com.liferay.portal.NoSuchResourceCodeException,
151             com.liferay.portal.SystemException {
152         return getPersistence()
153                    .findByCompanyId_PrevAndNext(codeId, companyId, obc);
154     }
155 
156     public static java.util.List<com.liferay.portal.model.ResourceCode> findByName(
157         java.lang.String name) throws com.liferay.portal.SystemException {
158         return getPersistence().findByName(name);
159     }
160 
161     public static java.util.List<com.liferay.portal.model.ResourceCode> findByName(
162         java.lang.String name, int start, int end)
163         throws com.liferay.portal.SystemException {
164         return getPersistence().findByName(name, start, end);
165     }
166 
167     public static java.util.List<com.liferay.portal.model.ResourceCode> findByName(
168         java.lang.String name, int start, int end,
169         com.liferay.portal.kernel.util.OrderByComparator obc)
170         throws com.liferay.portal.SystemException {
171         return getPersistence().findByName(name, start, end, obc);
172     }
173 
174     public static com.liferay.portal.model.ResourceCode findByName_First(
175         java.lang.String name,
176         com.liferay.portal.kernel.util.OrderByComparator obc)
177         throws com.liferay.portal.NoSuchResourceCodeException,
178             com.liferay.portal.SystemException {
179         return getPersistence().findByName_First(name, obc);
180     }
181 
182     public static com.liferay.portal.model.ResourceCode findByName_Last(
183         java.lang.String name,
184         com.liferay.portal.kernel.util.OrderByComparator obc)
185         throws com.liferay.portal.NoSuchResourceCodeException,
186             com.liferay.portal.SystemException {
187         return getPersistence().findByName_Last(name, obc);
188     }
189 
190     public static com.liferay.portal.model.ResourceCode[] findByName_PrevAndNext(
191         long codeId, java.lang.String name,
192         com.liferay.portal.kernel.util.OrderByComparator obc)
193         throws com.liferay.portal.NoSuchResourceCodeException,
194             com.liferay.portal.SystemException {
195         return getPersistence().findByName_PrevAndNext(codeId, name, obc);
196     }
197 
198     public static com.liferay.portal.model.ResourceCode findByC_N_S(
199         long companyId, java.lang.String name, int scope)
200         throws com.liferay.portal.NoSuchResourceCodeException,
201             com.liferay.portal.SystemException {
202         return getPersistence().findByC_N_S(companyId, name, scope);
203     }
204 
205     public static com.liferay.portal.model.ResourceCode fetchByC_N_S(
206         long companyId, java.lang.String name, int scope)
207         throws com.liferay.portal.SystemException {
208         return getPersistence().fetchByC_N_S(companyId, name, scope);
209     }
210 
211     public static com.liferay.portal.model.ResourceCode fetchByC_N_S(
212         long companyId, java.lang.String name, int scope,
213         boolean retrieveFromCache) throws com.liferay.portal.SystemException {
214         return getPersistence()
215                    .fetchByC_N_S(companyId, name, scope, retrieveFromCache);
216     }
217 
218     public static java.util.List<Object> findWithDynamicQuery(
219         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
220         throws com.liferay.portal.SystemException {
221         return getPersistence().findWithDynamicQuery(dynamicQuery);
222     }
223 
224     public static java.util.List<Object> findWithDynamicQuery(
225         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
226         int end) throws com.liferay.portal.SystemException {
227         return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
228     }
229 
230     public static java.util.List<com.liferay.portal.model.ResourceCode> findAll()
231         throws com.liferay.portal.SystemException {
232         return getPersistence().findAll();
233     }
234 
235     public static java.util.List<com.liferay.portal.model.ResourceCode> findAll(
236         int start, int end) throws com.liferay.portal.SystemException {
237         return getPersistence().findAll(start, end);
238     }
239 
240     public static java.util.List<com.liferay.portal.model.ResourceCode> findAll(
241         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
242         throws com.liferay.portal.SystemException {
243         return getPersistence().findAll(start, end, obc);
244     }
245 
246     public static void removeByCompanyId(long companyId)
247         throws com.liferay.portal.SystemException {
248         getPersistence().removeByCompanyId(companyId);
249     }
250 
251     public static void removeByName(java.lang.String name)
252         throws com.liferay.portal.SystemException {
253         getPersistence().removeByName(name);
254     }
255 
256     public static void removeByC_N_S(long companyId, java.lang.String name,
257         int scope)
258         throws com.liferay.portal.NoSuchResourceCodeException,
259             com.liferay.portal.SystemException {
260         getPersistence().removeByC_N_S(companyId, name, scope);
261     }
262 
263     public static void removeAll() throws com.liferay.portal.SystemException {
264         getPersistence().removeAll();
265     }
266 
267     public static int countByCompanyId(long companyId)
268         throws com.liferay.portal.SystemException {
269         return getPersistence().countByCompanyId(companyId);
270     }
271 
272     public static int countByName(java.lang.String name)
273         throws com.liferay.portal.SystemException {
274         return getPersistence().countByName(name);
275     }
276 
277     public static int countByC_N_S(long companyId, java.lang.String name,
278         int scope) throws com.liferay.portal.SystemException {
279         return getPersistence().countByC_N_S(companyId, name, scope);
280     }
281 
282     public static int countAll() throws com.liferay.portal.SystemException {
283         return getPersistence().countAll();
284     }
285 
286     public static ResourceCodePersistence getPersistence() {
287         return _persistence;
288     }
289 
290     public void setPersistence(ResourceCodePersistence persistence) {
291         _persistence = persistence;
292     }
293 
294     private static ResourceCodePersistence _persistence;
295 }