1   /**
2    * Copyright (c) 2000-2010 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   *
12   * 
13   */
14  
15  package com.liferay.portal.service.persistence;
16  
17  import com.liferay.portal.SystemException;
18  import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
19  import com.liferay.portal.kernel.dao.orm.DynamicQuery;
20  import com.liferay.portal.model.Resource;
21  
22  import java.util.List;
23  
24  /**
25   * <a href="ResourceUtil.java.html"><b><i>View Source</i></b></a>
26   *
27   * <p>
28   * ServiceBuilder generated this class. Modifications in this class will be
29   * overwritten the next time is generated.
30   * </p>
31   *
32   * @author    Brian Wing Shun Chan
33   * @see       ResourcePersistence
34   * @see       ResourcePersistenceImpl
35   * @generated
36   */
37  public class ResourceUtil {
38      /**
39       * @see com.liferay.portal.service.persistence.BasePersistence#clearCache()
40       */
41      public static void clearCache() {
42          getPersistence().clearCache();
43      }
44  
45      /**
46       * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery)
47       */
48      public static List<Object> findWithDynamicQuery(DynamicQuery dynamicQuery)
49          throws SystemException {
50          return getPersistence().findWithDynamicQuery(dynamicQuery);
51      }
52  
53      /**
54       * @see com.liferay.portal.service.persistence.BasePersistence#findWithDynamicQuery(DynamicQuery, int, int)
55       */
56      public static List<Object> findWithDynamicQuery(DynamicQuery dynamicQuery,
57          int start, int end) throws SystemException {
58          return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
59      }
60  
61      /**
62       * @see com.liferay.portal.service.persistence.BasePersistence#remove(com.liferay.portal.model.BaseModel)
63       */
64      public static Resource remove(Resource resource) throws SystemException {
65          return getPersistence().remove(resource);
66      }
67  
68      /**
69       * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean)
70       */
71      public static Resource update(Resource resource, boolean merge)
72          throws SystemException {
73          return getPersistence().update(resource, merge);
74      }
75  
76      public static void cacheResult(com.liferay.portal.model.Resource resource) {
77          getPersistence().cacheResult(resource);
78      }
79  
80      public static void cacheResult(
81          java.util.List<com.liferay.portal.model.Resource> resources) {
82          getPersistence().cacheResult(resources);
83      }
84  
85      public static com.liferay.portal.model.Resource create(long resourceId) {
86          return getPersistence().create(resourceId);
87      }
88  
89      public static com.liferay.portal.model.Resource remove(long resourceId)
90          throws com.liferay.portal.NoSuchResourceException,
91              com.liferay.portal.SystemException {
92          return getPersistence().remove(resourceId);
93      }
94  
95      /**
96       * @deprecated Use {@link com.liferay.portal.service.persistence.BasePersistence.#update(com.liferay.portal.model.BaseModel, boolean)}.
97       */
98      public static com.liferay.portal.model.Resource update(
99          com.liferay.portal.model.Resource resource)
100         throws com.liferay.portal.SystemException {
101         return getPersistence().update(resource);
102     }
103 
104     public static com.liferay.portal.model.Resource updateImpl(
105         com.liferay.portal.model.Resource resource, boolean merge)
106         throws com.liferay.portal.SystemException {
107         return getPersistence().updateImpl(resource, merge);
108     }
109 
110     public static com.liferay.portal.model.Resource findByPrimaryKey(
111         long resourceId)
112         throws com.liferay.portal.NoSuchResourceException,
113             com.liferay.portal.SystemException {
114         return getPersistence().findByPrimaryKey(resourceId);
115     }
116 
117     public static com.liferay.portal.model.Resource fetchByPrimaryKey(
118         long resourceId) throws com.liferay.portal.SystemException {
119         return getPersistence().fetchByPrimaryKey(resourceId);
120     }
121 
122     public static java.util.List<com.liferay.portal.model.Resource> findByCodeId(
123         long codeId) throws com.liferay.portal.SystemException {
124         return getPersistence().findByCodeId(codeId);
125     }
126 
127     public static java.util.List<com.liferay.portal.model.Resource> findByCodeId(
128         long codeId, int start, int end)
129         throws com.liferay.portal.SystemException {
130         return getPersistence().findByCodeId(codeId, start, end);
131     }
132 
133     public static java.util.List<com.liferay.portal.model.Resource> findByCodeId(
134         long codeId, int start, int end,
135         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
136         throws com.liferay.portal.SystemException {
137         return getPersistence()
138                    .findByCodeId(codeId, start, end, orderByComparator);
139     }
140 
141     public static com.liferay.portal.model.Resource findByCodeId_First(
142         long codeId,
143         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
144         throws com.liferay.portal.NoSuchResourceException,
145             com.liferay.portal.SystemException {
146         return getPersistence().findByCodeId_First(codeId, orderByComparator);
147     }
148 
149     public static com.liferay.portal.model.Resource findByCodeId_Last(
150         long codeId,
151         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
152         throws com.liferay.portal.NoSuchResourceException,
153             com.liferay.portal.SystemException {
154         return getPersistence().findByCodeId_Last(codeId, orderByComparator);
155     }
156 
157     public static com.liferay.portal.model.Resource[] findByCodeId_PrevAndNext(
158         long resourceId, long codeId,
159         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
160         throws com.liferay.portal.NoSuchResourceException,
161             com.liferay.portal.SystemException {
162         return getPersistence()
163                    .findByCodeId_PrevAndNext(resourceId, codeId,
164             orderByComparator);
165     }
166 
167     public static com.liferay.portal.model.Resource findByC_P(long codeId,
168         java.lang.String primKey)
169         throws com.liferay.portal.NoSuchResourceException,
170             com.liferay.portal.SystemException {
171         return getPersistence().findByC_P(codeId, primKey);
172     }
173 
174     public static com.liferay.portal.model.Resource fetchByC_P(long codeId,
175         java.lang.String primKey) throws com.liferay.portal.SystemException {
176         return getPersistence().fetchByC_P(codeId, primKey);
177     }
178 
179     public static com.liferay.portal.model.Resource fetchByC_P(long codeId,
180         java.lang.String primKey, boolean retrieveFromCache)
181         throws com.liferay.portal.SystemException {
182         return getPersistence().fetchByC_P(codeId, primKey, retrieveFromCache);
183     }
184 
185     public static java.util.List<com.liferay.portal.model.Resource> findAll()
186         throws com.liferay.portal.SystemException {
187         return getPersistence().findAll();
188     }
189 
190     public static java.util.List<com.liferay.portal.model.Resource> findAll(
191         int start, int end) throws com.liferay.portal.SystemException {
192         return getPersistence().findAll(start, end);
193     }
194 
195     public static java.util.List<com.liferay.portal.model.Resource> findAll(
196         int start, int end,
197         com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
198         throws com.liferay.portal.SystemException {
199         return getPersistence().findAll(start, end, orderByComparator);
200     }
201 
202     public static void removeByCodeId(long codeId)
203         throws com.liferay.portal.SystemException {
204         getPersistence().removeByCodeId(codeId);
205     }
206 
207     public static void removeByC_P(long codeId, java.lang.String primKey)
208         throws com.liferay.portal.NoSuchResourceException,
209             com.liferay.portal.SystemException {
210         getPersistence().removeByC_P(codeId, primKey);
211     }
212 
213     public static void removeAll() throws com.liferay.portal.SystemException {
214         getPersistence().removeAll();
215     }
216 
217     public static int countByCodeId(long codeId)
218         throws com.liferay.portal.SystemException {
219         return getPersistence().countByCodeId(codeId);
220     }
221 
222     public static int countByC_P(long codeId, java.lang.String primKey)
223         throws com.liferay.portal.SystemException {
224         return getPersistence().countByC_P(codeId, primKey);
225     }
226 
227     public static int countAll() throws com.liferay.portal.SystemException {
228         return getPersistence().countAll();
229     }
230 
231     public static ResourcePersistence getPersistence() {
232         if (_persistence == null) {
233             _persistence = (ResourcePersistence)PortalBeanLocatorUtil.locate(ResourcePersistence.class.getName());
234         }
235 
236         return _persistence;
237     }
238 
239     public void setPersistence(ResourcePersistence persistence) {
240         _persistence = persistence;
241     }
242 
243     private static ResourcePersistence _persistence;
244 }