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  import com.liferay.portal.SystemException;
26  import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
27  import com.liferay.portal.kernel.dao.orm.DynamicQuery;
28  import com.liferay.portal.model.ResourceCode;
29  
30  import java.util.List;
31  
32  /**
33   * <a href="ResourceCodeUtil.java.html"><b><i>View Source</i></b></a>
34   *
35   * <p>
36   * ServiceBuilder generated this class. Modifications in this class will be
37   * overwritten the next time is generated.
38   * </p>
39   *
40   * @author    Brian Wing Shun Chan
41   * @see       ResourceCodePersistence
42   * @see       ResourceCodePersistenceImpl
43   * @generated
44   */
45  public class ResourceCodeUtil {
46      /**
47       * @see com.liferay.portal.service.persistence.BasePersistence#clearCache()
48       */
49      public static void clearCache() {
50          getPersistence().clearCache();
51      }
52  
53      /**
54       * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery)
55       */
56      public static List<Object> findWithDynamicQuery(DynamicQuery dynamicQuery)
57          throws SystemException {
58          return getPersistence().findWithDynamicQuery(dynamicQuery);
59      }
60  
61      /**
62       * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int)
63       */
64      public static List<Object> findWithDynamicQuery(DynamicQuery dynamicQuery,
65          int start, int end) throws SystemException {
66          return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
67      }
68  
69      /**
70       * @see com.liferay.portal.service.persistence.BasePersistence#remove(com.liferay.portal.model.BaseModel)
71       */
72      public static ResourceCode remove(ResourceCode resourceCode)
73          throws SystemException {
74          return getPersistence().remove(resourceCode);
75      }
76  
77      /**
78       * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean)
79       */
80      public static ResourceCode update(ResourceCode resourceCode, boolean merge)
81          throws SystemException {
82          return getPersistence().update(resourceCode, merge);
83      }
84  
85      public static void cacheResult(
86          com.liferay.portal.model.ResourceCode resourceCode) {
87          getPersistence().cacheResult(resourceCode);
88      }
89  
90      public static void cacheResult(
91          java.util.List<com.liferay.portal.model.ResourceCode> resourceCodes) {
92          getPersistence().cacheResult(resourceCodes);
93      }
94  
95      public static com.liferay.portal.model.ResourceCode create(long codeId) {
96          return getPersistence().create(codeId);
97      }
98  
99      public static com.liferay.portal.model.ResourceCode remove(long codeId)
100         throws com.liferay.portal.NoSuchResourceCodeException,
101             com.liferay.portal.SystemException {
102         return getPersistence().remove(codeId);
103     }
104 
105     /**
106      * @deprecated Use {@link com.liferay.portal.service.persistence.BasePersistence.#update(com.liferay.portal.model.BaseModel, boolean)}.
107      */
108     public static com.liferay.portal.model.ResourceCode update(
109         com.liferay.portal.model.ResourceCode resourceCode)
110         throws com.liferay.portal.SystemException {
111         return getPersistence().update(resourceCode);
112     }
113 
114     public static com.liferay.portal.model.ResourceCode updateImpl(
115         com.liferay.portal.model.ResourceCode resourceCode, boolean merge)
116         throws com.liferay.portal.SystemException {
117         return getPersistence().updateImpl(resourceCode, merge);
118     }
119 
120     public static com.liferay.portal.model.ResourceCode findByPrimaryKey(
121         long codeId)
122         throws com.liferay.portal.NoSuchResourceCodeException,
123             com.liferay.portal.SystemException {
124         return getPersistence().findByPrimaryKey(codeId);
125     }
126 
127     public static com.liferay.portal.model.ResourceCode fetchByPrimaryKey(
128         long codeId) throws com.liferay.portal.SystemException {
129         return getPersistence().fetchByPrimaryKey(codeId);
130     }
131 
132     public static java.util.List<com.liferay.portal.model.ResourceCode> findByCompanyId(
133         long companyId) throws com.liferay.portal.SystemException {
134         return getPersistence().findByCompanyId(companyId);
135     }
136 
137     public static java.util.List<com.liferay.portal.model.ResourceCode> findByCompanyId(
138         long companyId, int start, int end)
139         throws com.liferay.portal.SystemException {
140         return getPersistence().findByCompanyId(companyId, start, end);
141     }
142 
143     public static java.util.List<com.liferay.portal.model.ResourceCode> findByCompanyId(
144         long companyId, int start, int end,
145         com.liferay.portal.kernel.util.OrderByComparator obc)
146         throws com.liferay.portal.SystemException {
147         return getPersistence().findByCompanyId(companyId, start, end, obc);
148     }
149 
150     public static com.liferay.portal.model.ResourceCode findByCompanyId_First(
151         long companyId, com.liferay.portal.kernel.util.OrderByComparator obc)
152         throws com.liferay.portal.NoSuchResourceCodeException,
153             com.liferay.portal.SystemException {
154         return getPersistence().findByCompanyId_First(companyId, obc);
155     }
156 
157     public static com.liferay.portal.model.ResourceCode findByCompanyId_Last(
158         long companyId, com.liferay.portal.kernel.util.OrderByComparator obc)
159         throws com.liferay.portal.NoSuchResourceCodeException,
160             com.liferay.portal.SystemException {
161         return getPersistence().findByCompanyId_Last(companyId, obc);
162     }
163 
164     public static com.liferay.portal.model.ResourceCode[] findByCompanyId_PrevAndNext(
165         long codeId, long companyId,
166         com.liferay.portal.kernel.util.OrderByComparator obc)
167         throws com.liferay.portal.NoSuchResourceCodeException,
168             com.liferay.portal.SystemException {
169         return getPersistence()
170                    .findByCompanyId_PrevAndNext(codeId, companyId, obc);
171     }
172 
173     public static java.util.List<com.liferay.portal.model.ResourceCode> findByName(
174         java.lang.String name) throws com.liferay.portal.SystemException {
175         return getPersistence().findByName(name);
176     }
177 
178     public static java.util.List<com.liferay.portal.model.ResourceCode> findByName(
179         java.lang.String name, int start, int end)
180         throws com.liferay.portal.SystemException {
181         return getPersistence().findByName(name, start, end);
182     }
183 
184     public static java.util.List<com.liferay.portal.model.ResourceCode> findByName(
185         java.lang.String name, int start, int end,
186         com.liferay.portal.kernel.util.OrderByComparator obc)
187         throws com.liferay.portal.SystemException {
188         return getPersistence().findByName(name, start, end, obc);
189     }
190 
191     public static com.liferay.portal.model.ResourceCode findByName_First(
192         java.lang.String name,
193         com.liferay.portal.kernel.util.OrderByComparator obc)
194         throws com.liferay.portal.NoSuchResourceCodeException,
195             com.liferay.portal.SystemException {
196         return getPersistence().findByName_First(name, obc);
197     }
198 
199     public static com.liferay.portal.model.ResourceCode findByName_Last(
200         java.lang.String name,
201         com.liferay.portal.kernel.util.OrderByComparator obc)
202         throws com.liferay.portal.NoSuchResourceCodeException,
203             com.liferay.portal.SystemException {
204         return getPersistence().findByName_Last(name, obc);
205     }
206 
207     public static com.liferay.portal.model.ResourceCode[] findByName_PrevAndNext(
208         long codeId, java.lang.String name,
209         com.liferay.portal.kernel.util.OrderByComparator obc)
210         throws com.liferay.portal.NoSuchResourceCodeException,
211             com.liferay.portal.SystemException {
212         return getPersistence().findByName_PrevAndNext(codeId, name, obc);
213     }
214 
215     public static com.liferay.portal.model.ResourceCode findByC_N_S(
216         long companyId, java.lang.String name, int scope)
217         throws com.liferay.portal.NoSuchResourceCodeException,
218             com.liferay.portal.SystemException {
219         return getPersistence().findByC_N_S(companyId, name, scope);
220     }
221 
222     public static com.liferay.portal.model.ResourceCode fetchByC_N_S(
223         long companyId, java.lang.String name, int scope)
224         throws com.liferay.portal.SystemException {
225         return getPersistence().fetchByC_N_S(companyId, name, scope);
226     }
227 
228     public static com.liferay.portal.model.ResourceCode fetchByC_N_S(
229         long companyId, java.lang.String name, int scope,
230         boolean retrieveFromCache) throws com.liferay.portal.SystemException {
231         return getPersistence()
232                    .fetchByC_N_S(companyId, name, scope, retrieveFromCache);
233     }
234 
235     public static java.util.List<com.liferay.portal.model.ResourceCode> findAll()
236         throws com.liferay.portal.SystemException {
237         return getPersistence().findAll();
238     }
239 
240     public static java.util.List<com.liferay.portal.model.ResourceCode> findAll(
241         int start, int end) throws com.liferay.portal.SystemException {
242         return getPersistence().findAll(start, end);
243     }
244 
245     public static java.util.List<com.liferay.portal.model.ResourceCode> findAll(
246         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
247         throws com.liferay.portal.SystemException {
248         return getPersistence().findAll(start, end, obc);
249     }
250 
251     public static void removeByCompanyId(long companyId)
252         throws com.liferay.portal.SystemException {
253         getPersistence().removeByCompanyId(companyId);
254     }
255 
256     public static void removeByName(java.lang.String name)
257         throws com.liferay.portal.SystemException {
258         getPersistence().removeByName(name);
259     }
260 
261     public static void removeByC_N_S(long companyId, java.lang.String name,
262         int scope)
263         throws com.liferay.portal.NoSuchResourceCodeException,
264             com.liferay.portal.SystemException {
265         getPersistence().removeByC_N_S(companyId, name, scope);
266     }
267 
268     public static void removeAll() throws com.liferay.portal.SystemException {
269         getPersistence().removeAll();
270     }
271 
272     public static int countByCompanyId(long companyId)
273         throws com.liferay.portal.SystemException {
274         return getPersistence().countByCompanyId(companyId);
275     }
276 
277     public static int countByName(java.lang.String name)
278         throws com.liferay.portal.SystemException {
279         return getPersistence().countByName(name);
280     }
281 
282     public static int countByC_N_S(long companyId, java.lang.String name,
283         int scope) throws com.liferay.portal.SystemException {
284         return getPersistence().countByC_N_S(companyId, name, scope);
285     }
286 
287     public static int countAll() throws com.liferay.portal.SystemException {
288         return getPersistence().countAll();
289     }
290 
291     public static ResourceCodePersistence getPersistence() {
292         if (_persistence == null) {
293             _persistence = (ResourceCodePersistence)PortalBeanLocatorUtil.locate(ResourceCodePersistence.class.getName());
294         }
295 
296         return _persistence;
297     }
298 
299     public void setPersistence(ResourceCodePersistence persistence) {
300         _persistence = persistence;
301     }
302 
303     private static ResourceCodePersistence _persistence;
304 }