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 obc)
136         throws com.liferay.portal.SystemException {
137         return getPersistence().findByCodeId(codeId, start, end, obc);
138     }
139 
140     public static com.liferay.portal.model.Resource findByCodeId_First(
141         long codeId, com.liferay.portal.kernel.util.OrderByComparator obc)
142         throws com.liferay.portal.NoSuchResourceException,
143             com.liferay.portal.SystemException {
144         return getPersistence().findByCodeId_First(codeId, obc);
145     }
146 
147     public static com.liferay.portal.model.Resource findByCodeId_Last(
148         long codeId, com.liferay.portal.kernel.util.OrderByComparator obc)
149         throws com.liferay.portal.NoSuchResourceException,
150             com.liferay.portal.SystemException {
151         return getPersistence().findByCodeId_Last(codeId, obc);
152     }
153 
154     public static com.liferay.portal.model.Resource[] findByCodeId_PrevAndNext(
155         long resourceId, long codeId,
156         com.liferay.portal.kernel.util.OrderByComparator obc)
157         throws com.liferay.portal.NoSuchResourceException,
158             com.liferay.portal.SystemException {
159         return getPersistence().findByCodeId_PrevAndNext(resourceId, codeId, obc);
160     }
161 
162     public static com.liferay.portal.model.Resource findByC_P(long codeId,
163         java.lang.String primKey)
164         throws com.liferay.portal.NoSuchResourceException,
165             com.liferay.portal.SystemException {
166         return getPersistence().findByC_P(codeId, primKey);
167     }
168 
169     public static com.liferay.portal.model.Resource fetchByC_P(long codeId,
170         java.lang.String primKey) throws com.liferay.portal.SystemException {
171         return getPersistence().fetchByC_P(codeId, primKey);
172     }
173 
174     public static com.liferay.portal.model.Resource fetchByC_P(long codeId,
175         java.lang.String primKey, boolean retrieveFromCache)
176         throws com.liferay.portal.SystemException {
177         return getPersistence().fetchByC_P(codeId, primKey, retrieveFromCache);
178     }
179 
180     public static java.util.List<com.liferay.portal.model.Resource> findAll()
181         throws com.liferay.portal.SystemException {
182         return getPersistence().findAll();
183     }
184 
185     public static java.util.List<com.liferay.portal.model.Resource> findAll(
186         int start, int end) throws com.liferay.portal.SystemException {
187         return getPersistence().findAll(start, end);
188     }
189 
190     public static java.util.List<com.liferay.portal.model.Resource> findAll(
191         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
192         throws com.liferay.portal.SystemException {
193         return getPersistence().findAll(start, end, obc);
194     }
195 
196     public static void removeByCodeId(long codeId)
197         throws com.liferay.portal.SystemException {
198         getPersistence().removeByCodeId(codeId);
199     }
200 
201     public static void removeByC_P(long codeId, java.lang.String primKey)
202         throws com.liferay.portal.NoSuchResourceException,
203             com.liferay.portal.SystemException {
204         getPersistence().removeByC_P(codeId, primKey);
205     }
206 
207     public static void removeAll() throws com.liferay.portal.SystemException {
208         getPersistence().removeAll();
209     }
210 
211     public static int countByCodeId(long codeId)
212         throws com.liferay.portal.SystemException {
213         return getPersistence().countByCodeId(codeId);
214     }
215 
216     public static int countByC_P(long codeId, java.lang.String primKey)
217         throws com.liferay.portal.SystemException {
218         return getPersistence().countByC_P(codeId, primKey);
219     }
220 
221     public static int countAll() throws com.liferay.portal.SystemException {
222         return getPersistence().countAll();
223     }
224 
225     public static ResourcePersistence getPersistence() {
226         if (_persistence == null) {
227             _persistence = (ResourcePersistence)PortalBeanLocatorUtil.locate(ResourcePersistence.class.getName());
228         }
229 
230         return _persistence;
231     }
232 
233     public void setPersistence(ResourcePersistence persistence) {
234         _persistence = persistence;
235     }
236 
237     private static ResourcePersistence _persistence;
238 }