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.Resource;
29  
30  import java.util.List;
31  
32  /**
33   * <a href="ResourceUtil.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       ResourcePersistence
42   * @see       ResourcePersistenceImpl
43   * @generated
44   */
45  public class ResourceUtil {
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 Resource remove(Resource resource) throws SystemException {
73          return getPersistence().remove(resource);
74      }
75  
76      /**
77       * @see com.liferay.portal.service.persistence.BasePersistence#update(com.liferay.portal.model.BaseModel, boolean)
78       */
79      public static Resource update(Resource resource, boolean merge)
80          throws SystemException {
81          return getPersistence().update(resource, merge);
82      }
83  
84      public static void cacheResult(com.liferay.portal.model.Resource resource) {
85          getPersistence().cacheResult(resource);
86      }
87  
88      public static void cacheResult(
89          java.util.List<com.liferay.portal.model.Resource> resources) {
90          getPersistence().cacheResult(resources);
91      }
92  
93      public static com.liferay.portal.model.Resource create(long resourceId) {
94          return getPersistence().create(resourceId);
95      }
96  
97      public static com.liferay.portal.model.Resource remove(long resourceId)
98          throws com.liferay.portal.NoSuchResourceException,
99              com.liferay.portal.SystemException {
100         return getPersistence().remove(resourceId);
101     }
102 
103     /**
104      * @deprecated Use {@link com.liferay.portal.service.persistence.BasePersistence.#update(com.liferay.portal.model.BaseModel, boolean)}.
105      */
106     public static com.liferay.portal.model.Resource update(
107         com.liferay.portal.model.Resource resource)
108         throws com.liferay.portal.SystemException {
109         return getPersistence().update(resource);
110     }
111 
112     public static com.liferay.portal.model.Resource updateImpl(
113         com.liferay.portal.model.Resource resource, boolean merge)
114         throws com.liferay.portal.SystemException {
115         return getPersistence().updateImpl(resource, merge);
116     }
117 
118     public static com.liferay.portal.model.Resource findByPrimaryKey(
119         long resourceId)
120         throws com.liferay.portal.NoSuchResourceException,
121             com.liferay.portal.SystemException {
122         return getPersistence().findByPrimaryKey(resourceId);
123     }
124 
125     public static com.liferay.portal.model.Resource fetchByPrimaryKey(
126         long resourceId) throws com.liferay.portal.SystemException {
127         return getPersistence().fetchByPrimaryKey(resourceId);
128     }
129 
130     public static java.util.List<com.liferay.portal.model.Resource> findByCodeId(
131         long codeId) throws com.liferay.portal.SystemException {
132         return getPersistence().findByCodeId(codeId);
133     }
134 
135     public static java.util.List<com.liferay.portal.model.Resource> findByCodeId(
136         long codeId, int start, int end)
137         throws com.liferay.portal.SystemException {
138         return getPersistence().findByCodeId(codeId, start, end);
139     }
140 
141     public static java.util.List<com.liferay.portal.model.Resource> findByCodeId(
142         long codeId, int start, int end,
143         com.liferay.portal.kernel.util.OrderByComparator obc)
144         throws com.liferay.portal.SystemException {
145         return getPersistence().findByCodeId(codeId, start, end, obc);
146     }
147 
148     public static com.liferay.portal.model.Resource findByCodeId_First(
149         long codeId, com.liferay.portal.kernel.util.OrderByComparator obc)
150         throws com.liferay.portal.NoSuchResourceException,
151             com.liferay.portal.SystemException {
152         return getPersistence().findByCodeId_First(codeId, obc);
153     }
154 
155     public static com.liferay.portal.model.Resource findByCodeId_Last(
156         long codeId, com.liferay.portal.kernel.util.OrderByComparator obc)
157         throws com.liferay.portal.NoSuchResourceException,
158             com.liferay.portal.SystemException {
159         return getPersistence().findByCodeId_Last(codeId, obc);
160     }
161 
162     public static com.liferay.portal.model.Resource[] findByCodeId_PrevAndNext(
163         long resourceId, long codeId,
164         com.liferay.portal.kernel.util.OrderByComparator obc)
165         throws com.liferay.portal.NoSuchResourceException,
166             com.liferay.portal.SystemException {
167         return getPersistence().findByCodeId_PrevAndNext(resourceId, codeId, obc);
168     }
169 
170     public static com.liferay.portal.model.Resource findByC_P(long codeId,
171         java.lang.String primKey)
172         throws com.liferay.portal.NoSuchResourceException,
173             com.liferay.portal.SystemException {
174         return getPersistence().findByC_P(codeId, primKey);
175     }
176 
177     public static com.liferay.portal.model.Resource fetchByC_P(long codeId,
178         java.lang.String primKey) throws com.liferay.portal.SystemException {
179         return getPersistence().fetchByC_P(codeId, primKey);
180     }
181 
182     public static com.liferay.portal.model.Resource fetchByC_P(long codeId,
183         java.lang.String primKey, boolean retrieveFromCache)
184         throws com.liferay.portal.SystemException {
185         return getPersistence().fetchByC_P(codeId, primKey, retrieveFromCache);
186     }
187 
188     public static java.util.List<com.liferay.portal.model.Resource> findAll()
189         throws com.liferay.portal.SystemException {
190         return getPersistence().findAll();
191     }
192 
193     public static java.util.List<com.liferay.portal.model.Resource> findAll(
194         int start, int end) throws com.liferay.portal.SystemException {
195         return getPersistence().findAll(start, end);
196     }
197 
198     public static java.util.List<com.liferay.portal.model.Resource> findAll(
199         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
200         throws com.liferay.portal.SystemException {
201         return getPersistence().findAll(start, end, obc);
202     }
203 
204     public static void removeByCodeId(long codeId)
205         throws com.liferay.portal.SystemException {
206         getPersistence().removeByCodeId(codeId);
207     }
208 
209     public static void removeByC_P(long codeId, java.lang.String primKey)
210         throws com.liferay.portal.NoSuchResourceException,
211             com.liferay.portal.SystemException {
212         getPersistence().removeByC_P(codeId, primKey);
213     }
214 
215     public static void removeAll() throws com.liferay.portal.SystemException {
216         getPersistence().removeAll();
217     }
218 
219     public static int countByCodeId(long codeId)
220         throws com.liferay.portal.SystemException {
221         return getPersistence().countByCodeId(codeId);
222     }
223 
224     public static int countByC_P(long codeId, java.lang.String primKey)
225         throws com.liferay.portal.SystemException {
226         return getPersistence().countByC_P(codeId, primKey);
227     }
228 
229     public static int countAll() throws com.liferay.portal.SystemException {
230         return getPersistence().countAll();
231     }
232 
233     public static ResourcePersistence getPersistence() {
234         if (_persistence == null) {
235             _persistence = (ResourcePersistence)PortalBeanLocatorUtil.locate(ResourcePersistence.class.getName());
236         }
237 
238         return _persistence;
239     }
240 
241     public void setPersistence(ResourcePersistence persistence) {
242         _persistence = persistence;
243     }
244 
245     private static ResourcePersistence _persistence;
246 }