001
014
015 package com.liferay.portal.service.persistence;
016
017 import com.liferay.portal.kernel.bean.PortalBeanLocatorUtil;
018 import com.liferay.portal.kernel.dao.orm.DynamicQuery;
019 import com.liferay.portal.kernel.exception.SystemException;
020 import com.liferay.portal.kernel.util.OrderByComparator;
021 import com.liferay.portal.model.Resource;
022 import com.liferay.portal.service.ServiceContext;
023
024 import java.util.List;
025
026
032 public class ResourceUtil {
033
036 public static void clearCache() {
037 getPersistence().clearCache();
038 }
039
040
043 public static void clearCache(Resource resource) {
044 getPersistence().clearCache(resource);
045 }
046
047
050 public long countWithDynamicQuery(DynamicQuery dynamicQuery)
051 throws SystemException {
052 return getPersistence().countWithDynamicQuery(dynamicQuery);
053 }
054
055
058 public static List<Resource> findWithDynamicQuery(DynamicQuery dynamicQuery)
059 throws SystemException {
060 return getPersistence().findWithDynamicQuery(dynamicQuery);
061 }
062
063
066 public static List<Resource> findWithDynamicQuery(
067 DynamicQuery dynamicQuery, int start, int end)
068 throws SystemException {
069 return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
070 }
071
072
075 public static List<Resource> findWithDynamicQuery(
076 DynamicQuery dynamicQuery, int start, int end,
077 OrderByComparator orderByComparator) throws SystemException {
078 return getPersistence()
079 .findWithDynamicQuery(dynamicQuery, start, end,
080 orderByComparator);
081 }
082
083
086 public static Resource remove(Resource resource) throws SystemException {
087 return getPersistence().remove(resource);
088 }
089
090
093 public static Resource update(Resource resource, boolean merge)
094 throws SystemException {
095 return getPersistence().update(resource, merge);
096 }
097
098
101 public static Resource update(Resource resource, boolean merge,
102 ServiceContext serviceContext) throws SystemException {
103 return getPersistence().update(resource, merge, serviceContext);
104 }
105
106 public static void cacheResult(com.liferay.portal.model.Resource resource) {
107 getPersistence().cacheResult(resource);
108 }
109
110 public static void cacheResult(
111 java.util.List<com.liferay.portal.model.Resource> resources) {
112 getPersistence().cacheResult(resources);
113 }
114
115 public static com.liferay.portal.model.Resource create(long resourceId) {
116 return getPersistence().create(resourceId);
117 }
118
119 public static com.liferay.portal.model.Resource remove(long resourceId)
120 throws com.liferay.portal.NoSuchResourceException,
121 com.liferay.portal.kernel.exception.SystemException {
122 return getPersistence().remove(resourceId);
123 }
124
125 public static com.liferay.portal.model.Resource updateImpl(
126 com.liferay.portal.model.Resource resource, boolean merge)
127 throws com.liferay.portal.kernel.exception.SystemException {
128 return getPersistence().updateImpl(resource, merge);
129 }
130
131 public static com.liferay.portal.model.Resource findByPrimaryKey(
132 long resourceId)
133 throws com.liferay.portal.NoSuchResourceException,
134 com.liferay.portal.kernel.exception.SystemException {
135 return getPersistence().findByPrimaryKey(resourceId);
136 }
137
138 public static com.liferay.portal.model.Resource fetchByPrimaryKey(
139 long resourceId)
140 throws com.liferay.portal.kernel.exception.SystemException {
141 return getPersistence().fetchByPrimaryKey(resourceId);
142 }
143
144 public static java.util.List<com.liferay.portal.model.Resource> findByCodeId(
145 long codeId) throws com.liferay.portal.kernel.exception.SystemException {
146 return getPersistence().findByCodeId(codeId);
147 }
148
149 public static java.util.List<com.liferay.portal.model.Resource> findByCodeId(
150 long codeId, int start, int end)
151 throws com.liferay.portal.kernel.exception.SystemException {
152 return getPersistence().findByCodeId(codeId, start, end);
153 }
154
155 public static java.util.List<com.liferay.portal.model.Resource> findByCodeId(
156 long codeId, int start, int end,
157 com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
158 throws com.liferay.portal.kernel.exception.SystemException {
159 return getPersistence()
160 .findByCodeId(codeId, start, end, orderByComparator);
161 }
162
163 public static com.liferay.portal.model.Resource findByCodeId_First(
164 long codeId,
165 com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
166 throws com.liferay.portal.NoSuchResourceException,
167 com.liferay.portal.kernel.exception.SystemException {
168 return getPersistence().findByCodeId_First(codeId, orderByComparator);
169 }
170
171 public static com.liferay.portal.model.Resource findByCodeId_Last(
172 long codeId,
173 com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
174 throws com.liferay.portal.NoSuchResourceException,
175 com.liferay.portal.kernel.exception.SystemException {
176 return getPersistence().findByCodeId_Last(codeId, orderByComparator);
177 }
178
179 public static com.liferay.portal.model.Resource[] findByCodeId_PrevAndNext(
180 long resourceId, long codeId,
181 com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
182 throws com.liferay.portal.NoSuchResourceException,
183 com.liferay.portal.kernel.exception.SystemException {
184 return getPersistence()
185 .findByCodeId_PrevAndNext(resourceId, codeId,
186 orderByComparator);
187 }
188
189 public static com.liferay.portal.model.Resource findByC_P(long codeId,
190 java.lang.String primKey)
191 throws com.liferay.portal.NoSuchResourceException,
192 com.liferay.portal.kernel.exception.SystemException {
193 return getPersistence().findByC_P(codeId, primKey);
194 }
195
196 public static com.liferay.portal.model.Resource fetchByC_P(long codeId,
197 java.lang.String primKey)
198 throws com.liferay.portal.kernel.exception.SystemException {
199 return getPersistence().fetchByC_P(codeId, primKey);
200 }
201
202 public static com.liferay.portal.model.Resource fetchByC_P(long codeId,
203 java.lang.String primKey, boolean retrieveFromCache)
204 throws com.liferay.portal.kernel.exception.SystemException {
205 return getPersistence().fetchByC_P(codeId, primKey, retrieveFromCache);
206 }
207
208 public static java.util.List<com.liferay.portal.model.Resource> findAll()
209 throws com.liferay.portal.kernel.exception.SystemException {
210 return getPersistence().findAll();
211 }
212
213 public static java.util.List<com.liferay.portal.model.Resource> findAll(
214 int start, int end)
215 throws com.liferay.portal.kernel.exception.SystemException {
216 return getPersistence().findAll(start, end);
217 }
218
219 public static java.util.List<com.liferay.portal.model.Resource> findAll(
220 int start, int end,
221 com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
222 throws com.liferay.portal.kernel.exception.SystemException {
223 return getPersistence().findAll(start, end, orderByComparator);
224 }
225
226 public static void removeByCodeId(long codeId)
227 throws com.liferay.portal.kernel.exception.SystemException {
228 getPersistence().removeByCodeId(codeId);
229 }
230
231 public static void removeByC_P(long codeId, java.lang.String primKey)
232 throws com.liferay.portal.NoSuchResourceException,
233 com.liferay.portal.kernel.exception.SystemException {
234 getPersistence().removeByC_P(codeId, primKey);
235 }
236
237 public static void removeAll()
238 throws com.liferay.portal.kernel.exception.SystemException {
239 getPersistence().removeAll();
240 }
241
242 public static int countByCodeId(long codeId)
243 throws com.liferay.portal.kernel.exception.SystemException {
244 return getPersistence().countByCodeId(codeId);
245 }
246
247 public static int countByC_P(long codeId, java.lang.String primKey)
248 throws com.liferay.portal.kernel.exception.SystemException {
249 return getPersistence().countByC_P(codeId, primKey);
250 }
251
252 public static int countAll()
253 throws com.liferay.portal.kernel.exception.SystemException {
254 return getPersistence().countAll();
255 }
256
257 public static ResourcePersistence getPersistence() {
258 if (_persistence == null) {
259 _persistence = (ResourcePersistence)PortalBeanLocatorUtil.locate(ResourcePersistence.class.getName());
260 }
261
262 return _persistence;
263 }
264
265 public void setPersistence(ResourcePersistence persistence) {
266 _persistence = persistence;
267 }
268
269 private static ResourcePersistence _persistence;
270 }