1   /**
2    * Copyright (c) 2000-2010 Liferay, Inc. All rights reserved.
3    *
4    * This library is free software; you can redistribute it and/or modify it under
5    * the terms of the GNU Lesser General Public License as published by the Free
6    * Software Foundation; either version 2.1 of the License, or (at your option)
7    * any later version.
8    *
9    * This library is distributed in the hope that it will be useful, but WITHOUT
10   * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
11   * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
12   * details.
13   */
14  
15  package com.liferay.portal.service.persistence;
16  
17  import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
18  import com.liferay.portal.kernel.dao.orm.DynamicQuery;
19  import com.liferay.portal.kernel.exception.SystemException;
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.kernel.exception.SystemException {
92          return getPersistence().remove(resourceId);
93      }
94  
95      public static com.liferay.portal.model.Resource updateImpl(
96          com.liferay.portal.model.Resource resource, boolean merge)
97          throws com.liferay.portal.kernel.exception.SystemException {
98          return getPersistence().updateImpl(resource, merge);
99      }
100 
101     public static com.liferay.portal.model.Resource findByPrimaryKey(
102         long resourceId)
103         throws com.liferay.portal.NoSuchResourceException,
104             com.liferay.portal.kernel.exception.SystemException {
105         return getPersistence().findByPrimaryKey(resourceId);
106     }
107 
108     public static com.liferay.portal.model.Resource fetchByPrimaryKey(
109         long resourceId)
110         throws com.liferay.portal.kernel.exception.SystemException {
111         return getPersistence().fetchByPrimaryKey(resourceId);
112     }
113 
114     public static java.util.List<com.liferay.portal.model.Resource> findByCodeId(
115         long codeId) throws com.liferay.portal.kernel.exception.SystemException {
116         return getPersistence().findByCodeId(codeId);
117     }
118 
119     public static java.util.List<com.liferay.portal.model.Resource> findByCodeId(
120         long codeId, int start, int end)
121         throws com.liferay.portal.kernel.exception.SystemException {
122         return getPersistence().findByCodeId(codeId, start, end);
123     }
124 
125     public static java.util.List<com.liferay.portal.model.Resource> findByCodeId(
126         long codeId, int start, int end,
127         com.liferay.portal.kernel.util.OrderByComparator obc)
128         throws com.liferay.portal.kernel.exception.SystemException {
129         return getPersistence().findByCodeId(codeId, start, end, obc);
130     }
131 
132     public static com.liferay.portal.model.Resource findByCodeId_First(
133         long codeId, com.liferay.portal.kernel.util.OrderByComparator obc)
134         throws com.liferay.portal.NoSuchResourceException,
135             com.liferay.portal.kernel.exception.SystemException {
136         return getPersistence().findByCodeId_First(codeId, obc);
137     }
138 
139     public static com.liferay.portal.model.Resource findByCodeId_Last(
140         long codeId, com.liferay.portal.kernel.util.OrderByComparator obc)
141         throws com.liferay.portal.NoSuchResourceException,
142             com.liferay.portal.kernel.exception.SystemException {
143         return getPersistence().findByCodeId_Last(codeId, obc);
144     }
145 
146     public static com.liferay.portal.model.Resource[] findByCodeId_PrevAndNext(
147         long resourceId, long codeId,
148         com.liferay.portal.kernel.util.OrderByComparator obc)
149         throws com.liferay.portal.NoSuchResourceException,
150             com.liferay.portal.kernel.exception.SystemException {
151         return getPersistence().findByCodeId_PrevAndNext(resourceId, codeId, obc);
152     }
153 
154     public static com.liferay.portal.model.Resource findByC_P(long codeId,
155         java.lang.String primKey)
156         throws com.liferay.portal.NoSuchResourceException,
157             com.liferay.portal.kernel.exception.SystemException {
158         return getPersistence().findByC_P(codeId, primKey);
159     }
160 
161     public static com.liferay.portal.model.Resource fetchByC_P(long codeId,
162         java.lang.String primKey)
163         throws com.liferay.portal.kernel.exception.SystemException {
164         return getPersistence().fetchByC_P(codeId, primKey);
165     }
166 
167     public static com.liferay.portal.model.Resource fetchByC_P(long codeId,
168         java.lang.String primKey, boolean retrieveFromCache)
169         throws com.liferay.portal.kernel.exception.SystemException {
170         return getPersistence().fetchByC_P(codeId, primKey, retrieveFromCache);
171     }
172 
173     public static java.util.List<com.liferay.portal.model.Resource> findAll()
174         throws com.liferay.portal.kernel.exception.SystemException {
175         return getPersistence().findAll();
176     }
177 
178     public static java.util.List<com.liferay.portal.model.Resource> findAll(
179         int start, int end)
180         throws com.liferay.portal.kernel.exception.SystemException {
181         return getPersistence().findAll(start, end);
182     }
183 
184     public static java.util.List<com.liferay.portal.model.Resource> findAll(
185         int start, int end, com.liferay.portal.kernel.util.OrderByComparator obc)
186         throws com.liferay.portal.kernel.exception.SystemException {
187         return getPersistence().findAll(start, end, obc);
188     }
189 
190     public static void removeByCodeId(long codeId)
191         throws com.liferay.portal.kernel.exception.SystemException {
192         getPersistence().removeByCodeId(codeId);
193     }
194 
195     public static void removeByC_P(long codeId, java.lang.String primKey)
196         throws com.liferay.portal.NoSuchResourceException,
197             com.liferay.portal.kernel.exception.SystemException {
198         getPersistence().removeByC_P(codeId, primKey);
199     }
200 
201     public static void removeAll()
202         throws com.liferay.portal.kernel.exception.SystemException {
203         getPersistence().removeAll();
204     }
205 
206     public static int countByCodeId(long codeId)
207         throws com.liferay.portal.kernel.exception.SystemException {
208         return getPersistence().countByCodeId(codeId);
209     }
210 
211     public static int countByC_P(long codeId, java.lang.String primKey)
212         throws com.liferay.portal.kernel.exception.SystemException {
213         return getPersistence().countByC_P(codeId, primKey);
214     }
215 
216     public static int countAll()
217         throws com.liferay.portal.kernel.exception.SystemException {
218         return getPersistence().countAll();
219     }
220 
221     public static ResourcePersistence getPersistence() {
222         if (_persistence == null) {
223             _persistence = (ResourcePersistence)PortalBeanLocatorUtil.locate(ResourcePersistence.class.getName());
224         }
225 
226         return _persistence;
227     }
228 
229     public void setPersistence(ResourcePersistence persistence) {
230         _persistence = persistence;
231     }
232 
233     private static ResourcePersistence _persistence;
234 }