1   /**
2    * Copyright (c) 2000-2009 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   * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
12   * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
13   * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
14   * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
15   * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
16   * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
17   * SOFTWARE.
18   */
19  
20  package com.liferay.portal.service.persistence;
21  
22  /**
23   * <a href="ResourceCodeUtil.java.html"><b><i>View Source</i></b></a>
24   *
25   * @author Brian Wing Shun Chan
26   *
27   */
28  public class ResourceCodeUtil {
29      public static void cacheResult(
30          com.liferay.portal.model.ResourceCode resourceCode) {
31          getPersistence().cacheResult(resourceCode);
32      }
33  
34      public static void cacheResult(
35          java.util.List<com.liferay.portal.model.ResourceCode> resourceCodes) {
36          getPersistence().cacheResult(resourceCodes);
37      }
38  
39      public static void clearCache() {
40          getPersistence().clearCache();
41      }
42  
43      public static com.liferay.portal.model.ResourceCode create(long codeId) {
44          return getPersistence().create(codeId);
45      }
46  
47      public static com.liferay.portal.model.ResourceCode remove(long codeId)
48          throws com.liferay.portal.NoSuchResourceCodeException,
49              com.liferay.portal.SystemException {
50          return getPersistence().remove(codeId);
51      }
52  
53      public static com.liferay.portal.model.ResourceCode remove(
54          com.liferay.portal.model.ResourceCode resourceCode)
55          throws com.liferay.portal.SystemException {
56          return getPersistence().remove(resourceCode);
57      }
58  
59      /**
60       * @deprecated Use <code>update(ResourceCode resourceCode, boolean merge)</code>.
61       */
62      public static com.liferay.portal.model.ResourceCode update(
63          com.liferay.portal.model.ResourceCode resourceCode)
64          throws com.liferay.portal.SystemException {
65          return getPersistence().update(resourceCode);
66      }
67  
68      /**
69       * Add, update, or merge, the entity. This method also calls the model
70       * listeners to trigger the proper events associated with adding, deleting,
71       * or updating an entity.
72       *
73       * @param        resourceCode the entity to add, update, or merge
74       * @param        merge boolean value for whether to merge the entity. The
75       *                default value is false. Setting merge to true is more
76       *                expensive and should only be true when resourceCode is
77       *                transient. See LEP-5473 for a detailed discussion of this
78       *                method.
79       * @return        true if the portlet can be displayed via Ajax
80       */
81      public static com.liferay.portal.model.ResourceCode update(
82          com.liferay.portal.model.ResourceCode resourceCode, boolean merge)
83          throws com.liferay.portal.SystemException {
84          return getPersistence().update(resourceCode, merge);
85      }
86  
87      public static com.liferay.portal.model.ResourceCode updateImpl(
88          com.liferay.portal.model.ResourceCode resourceCode, boolean merge)
89          throws com.liferay.portal.SystemException {
90          return getPersistence().updateImpl(resourceCode, merge);
91      }
92  
93      public static com.liferay.portal.model.ResourceCode findByPrimaryKey(
94          long codeId)
95          throws com.liferay.portal.NoSuchResourceCodeException,
96              com.liferay.portal.SystemException {
97          return getPersistence().findByPrimaryKey(codeId);
98      }
99  
100     public static com.liferay.portal.model.ResourceCode fetchByPrimaryKey(
101         long codeId) throws com.liferay.portal.SystemException {
102         return getPersistence().fetchByPrimaryKey(codeId);
103     }
104 
105     public static java.util.List<com.liferay.portal.model.ResourceCode> findByCompanyId(
106         long companyId) throws com.liferay.portal.SystemException {
107         return getPersistence().findByCompanyId(companyId);
108     }
109 
110     public static java.util.List<com.liferay.portal.model.ResourceCode> findByCompanyId(
111         long companyId, int start, int end)
112         throws com.liferay.portal.SystemException {
113         return getPersistence().findByCompanyId(companyId, start, end);
114     }
115 
116     public static java.util.List<com.liferay.portal.model.ResourceCode> findByCompanyId(
117         long companyId, int start, int end,
118         com.liferay.portal.kernel.util.OrderByComparator obc)
119         throws com.liferay.portal.SystemException {
120         return getPersistence().findByCompanyId(companyId, start, end, obc);
121     }
122 
123     public static com.liferay.portal.model.ResourceCode findByCompanyId_First(
124         long companyId, com.liferay.portal.kernel.util.OrderByComparator obc)
125         throws com.liferay.portal.NoSuchResourceCodeException,
126             com.liferay.portal.SystemException {
127         return getPersistence().findByCompanyId_First(companyId, obc);
128     }
129 
130     public static com.liferay.portal.model.ResourceCode findByCompanyId_Last(
131         long companyId, com.liferay.portal.kernel.util.OrderByComparator obc)
132         throws com.liferay.portal.NoSuchResourceCodeException,
133             com.liferay.portal.SystemException {
134         return getPersistence().findByCompanyId_Last(companyId, obc);
135     }
136 
137     public static com.liferay.portal.model.ResourceCode[] findByCompanyId_PrevAndNext(
138         long codeId, long companyId,
139         com.liferay.portal.kernel.util.OrderByComparator obc)
140         throws com.liferay.portal.NoSuchResourceCodeException,
141             com.liferay.portal.SystemException {
142         return getPersistence()
143                    .findByCompanyId_PrevAndNext(codeId, companyId, obc);
144     }
145 
146     public static java.util.List<com.liferay.portal.model.ResourceCode> findByName(
147         java.lang.String name) throws com.liferay.portal.SystemException {
148         return getPersistence().findByName(name);
149     }
150 
151     public static java.util.List<com.liferay.portal.model.ResourceCode> findByName(
152         java.lang.String name, int start, int end)
153         throws com.liferay.portal.SystemException {
154         return getPersistence().findByName(name, start, end);
155     }
156 
157     public static java.util.List<com.liferay.portal.model.ResourceCode> findByName(
158         java.lang.String name, int start, int end,
159         com.liferay.portal.kernel.util.OrderByComparator obc)
160         throws com.liferay.portal.SystemException {
161         return getPersistence().findByName(name, start, end, obc);
162     }
163 
164     public static com.liferay.portal.model.ResourceCode findByName_First(
165         java.lang.String name,
166         com.liferay.portal.kernel.util.OrderByComparator obc)
167         throws com.liferay.portal.NoSuchResourceCodeException,
168             com.liferay.portal.SystemException {
169         return getPersistence().findByName_First(name, obc);
170     }
171 
172     public static com.liferay.portal.model.ResourceCode findByName_Last(
173         java.lang.String name,
174         com.liferay.portal.kernel.util.OrderByComparator obc)
175         throws com.liferay.portal.NoSuchResourceCodeException,
176             com.liferay.portal.SystemException {
177         return getPersistence().findByName_Last(name, obc);
178     }
179 
180     public static com.liferay.portal.model.ResourceCode[] findByName_PrevAndNext(
181         long codeId, java.lang.String name,
182         com.liferay.portal.kernel.util.OrderByComparator obc)
183         throws com.liferay.portal.NoSuchResourceCodeException,
184             com.liferay.portal.SystemException {
185         return getPersistence().findByName_PrevAndNext(codeId, name, obc);
186     }
187 
188     public static com.liferay.portal.model.ResourceCode findByC_N_S(
189         long companyId, java.lang.String name, int scope)
190         throws com.liferay.portal.NoSuchResourceCodeException,
191             com.liferay.portal.SystemException {
192         return getPersistence().findByC_N_S(companyId, name, scope);
193     }
194 
195     public static com.liferay.portal.model.ResourceCode fetchByC_N_S(
196         long companyId, java.lang.String name, int scope)
197         throws com.liferay.portal.SystemException {
198         return getPersistence().fetchByC_N_S(companyId, name, scope);
199     }
200 
201     public static com.liferay.portal.model.ResourceCode fetchByC_N_S(
202         long companyId, java.lang.String name, int scope,
203         boolean retrieveFromCache) throws com.liferay.portal.SystemException {
204         return getPersistence()
205                    .fetchByC_N_S(companyId, name, scope, retrieveFromCache);
206     }
207 
208     public static java.util.List<Object> findWithDynamicQuery(
209         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
210         throws com.liferay.portal.SystemException {
211         return getPersistence().findWithDynamicQuery(dynamicQuery);
212     }
213 
214     public static java.util.List<Object> findWithDynamicQuery(
215         com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start,
216         int end) throws com.liferay.portal.SystemException {
217         return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
218     }
219 
220     public static java.util.List<com.liferay.portal.model.ResourceCode> findAll()
221         throws com.liferay.portal.SystemException {
222         return getPersistence().findAll();
223     }
224 
225     public static java.util.List<com.liferay.portal.model.ResourceCode> findAll(
226         int start, int end) throws com.liferay.portal.SystemException {
227         return getPersistence().findAll(start, end);
228     }
229 
230     public static java.util.List<com.liferay.portal.model.ResourceCode> findAll(
231         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
232         throws com.liferay.portal.SystemException {
233         return getPersistence().findAll(start, end, obc);
234     }
235 
236     public static void removeByCompanyId(long companyId)
237         throws com.liferay.portal.SystemException {
238         getPersistence().removeByCompanyId(companyId);
239     }
240 
241     public static void removeByName(java.lang.String name)
242         throws com.liferay.portal.SystemException {
243         getPersistence().removeByName(name);
244     }
245 
246     public static void removeByC_N_S(long companyId, java.lang.String name,
247         int scope)
248         throws com.liferay.portal.NoSuchResourceCodeException,
249             com.liferay.portal.SystemException {
250         getPersistence().removeByC_N_S(companyId, name, scope);
251     }
252 
253     public static void removeAll() throws com.liferay.portal.SystemException {
254         getPersistence().removeAll();
255     }
256 
257     public static int countByCompanyId(long companyId)
258         throws com.liferay.portal.SystemException {
259         return getPersistence().countByCompanyId(companyId);
260     }
261 
262     public static int countByName(java.lang.String name)
263         throws com.liferay.portal.SystemException {
264         return getPersistence().countByName(name);
265     }
266 
267     public static int countByC_N_S(long companyId, java.lang.String name,
268         int scope) throws com.liferay.portal.SystemException {
269         return getPersistence().countByC_N_S(companyId, name, scope);
270     }
271 
272     public static int countAll() throws com.liferay.portal.SystemException {
273         return getPersistence().countAll();
274     }
275 
276     public static ResourceCodePersistence getPersistence() {
277         return _persistence;
278     }
279 
280     public void setPersistence(ResourceCodePersistence persistence) {
281         _persistence = persistence;
282     }
283 
284     private static ResourceCodePersistence _persistence;
285 }