1
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
37 public class ResourceUtil {
38
41 public static void clearCache() {
42 getPersistence().clearCache();
43 }
44
45
48 public static void clearCache(Resource resource) {
49 getPersistence().clearCache(resource);
50 }
51
52
55 public long countWithDynamicQuery(DynamicQuery dynamicQuery)
56 throws SystemException {
57 return getPersistence().countWithDynamicQuery(dynamicQuery);
58 }
59
60
63 public static List<Resource> findWithDynamicQuery(DynamicQuery dynamicQuery)
64 throws SystemException {
65 return getPersistence().findWithDynamicQuery(dynamicQuery);
66 }
67
68
71 public static List<Resource> findWithDynamicQuery(
72 DynamicQuery dynamicQuery, int start, int end)
73 throws SystemException {
74 return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
75 }
76
77
80 public static Resource remove(Resource resource) throws SystemException {
81 return getPersistence().remove(resource);
82 }
83
84
87 public static Resource update(Resource resource, boolean merge)
88 throws SystemException {
89 return getPersistence().update(resource, merge);
90 }
91
92 public static void cacheResult(com.liferay.portal.model.Resource resource) {
93 getPersistence().cacheResult(resource);
94 }
95
96 public static void cacheResult(
97 java.util.List<com.liferay.portal.model.Resource> resources) {
98 getPersistence().cacheResult(resources);
99 }
100
101 public static com.liferay.portal.model.Resource create(long resourceId) {
102 return getPersistence().create(resourceId);
103 }
104
105 public static com.liferay.portal.model.Resource remove(long resourceId)
106 throws com.liferay.portal.NoSuchResourceException,
107 com.liferay.portal.kernel.exception.SystemException {
108 return getPersistence().remove(resourceId);
109 }
110
111 public static com.liferay.portal.model.Resource updateImpl(
112 com.liferay.portal.model.Resource resource, boolean merge)
113 throws com.liferay.portal.kernel.exception.SystemException {
114 return getPersistence().updateImpl(resource, merge);
115 }
116
117 public static com.liferay.portal.model.Resource findByPrimaryKey(
118 long resourceId)
119 throws com.liferay.portal.NoSuchResourceException,
120 com.liferay.portal.kernel.exception.SystemException {
121 return getPersistence().findByPrimaryKey(resourceId);
122 }
123
124 public static com.liferay.portal.model.Resource fetchByPrimaryKey(
125 long resourceId)
126 throws com.liferay.portal.kernel.exception.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.kernel.exception.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.kernel.exception.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 orderByComparator)
144 throws com.liferay.portal.kernel.exception.SystemException {
145 return getPersistence()
146 .findByCodeId(codeId, start, end, orderByComparator);
147 }
148
149 public static com.liferay.portal.model.Resource findByCodeId_First(
150 long codeId,
151 com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
152 throws com.liferay.portal.NoSuchResourceException,
153 com.liferay.portal.kernel.exception.SystemException {
154 return getPersistence().findByCodeId_First(codeId, orderByComparator);
155 }
156
157 public static com.liferay.portal.model.Resource findByCodeId_Last(
158 long codeId,
159 com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
160 throws com.liferay.portal.NoSuchResourceException,
161 com.liferay.portal.kernel.exception.SystemException {
162 return getPersistence().findByCodeId_Last(codeId, orderByComparator);
163 }
164
165 public static com.liferay.portal.model.Resource[] findByCodeId_PrevAndNext(
166 long resourceId, long codeId,
167 com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
168 throws com.liferay.portal.NoSuchResourceException,
169 com.liferay.portal.kernel.exception.SystemException {
170 return getPersistence()
171 .findByCodeId_PrevAndNext(resourceId, codeId,
172 orderByComparator);
173 }
174
175 public static com.liferay.portal.model.Resource findByC_P(long codeId,
176 java.lang.String primKey)
177 throws com.liferay.portal.NoSuchResourceException,
178 com.liferay.portal.kernel.exception.SystemException {
179 return getPersistence().findByC_P(codeId, primKey);
180 }
181
182 public static com.liferay.portal.model.Resource fetchByC_P(long codeId,
183 java.lang.String primKey)
184 throws com.liferay.portal.kernel.exception.SystemException {
185 return getPersistence().fetchByC_P(codeId, primKey);
186 }
187
188 public static com.liferay.portal.model.Resource fetchByC_P(long codeId,
189 java.lang.String primKey, boolean retrieveFromCache)
190 throws com.liferay.portal.kernel.exception.SystemException {
191 return getPersistence().fetchByC_P(codeId, primKey, retrieveFromCache);
192 }
193
194 public static java.util.List<com.liferay.portal.model.Resource> findAll()
195 throws com.liferay.portal.kernel.exception.SystemException {
196 return getPersistence().findAll();
197 }
198
199 public static java.util.List<com.liferay.portal.model.Resource> findAll(
200 int start, int end)
201 throws com.liferay.portal.kernel.exception.SystemException {
202 return getPersistence().findAll(start, end);
203 }
204
205 public static java.util.List<com.liferay.portal.model.Resource> findAll(
206 int start, int end,
207 com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
208 throws com.liferay.portal.kernel.exception.SystemException {
209 return getPersistence().findAll(start, end, orderByComparator);
210 }
211
212 public static void removeByCodeId(long codeId)
213 throws com.liferay.portal.kernel.exception.SystemException {
214 getPersistence().removeByCodeId(codeId);
215 }
216
217 public static void removeByC_P(long codeId, java.lang.String primKey)
218 throws com.liferay.portal.NoSuchResourceException,
219 com.liferay.portal.kernel.exception.SystemException {
220 getPersistence().removeByC_P(codeId, primKey);
221 }
222
223 public static void removeAll()
224 throws com.liferay.portal.kernel.exception.SystemException {
225 getPersistence().removeAll();
226 }
227
228 public static int countByCodeId(long codeId)
229 throws com.liferay.portal.kernel.exception.SystemException {
230 return getPersistence().countByCodeId(codeId);
231 }
232
233 public static int countByC_P(long codeId, java.lang.String primKey)
234 throws com.liferay.portal.kernel.exception.SystemException {
235 return getPersistence().countByC_P(codeId, primKey);
236 }
237
238 public static int countAll()
239 throws com.liferay.portal.kernel.exception.SystemException {
240 return getPersistence().countAll();
241 }
242
243 public static ResourcePersistence getPersistence() {
244 if (_persistence == null) {
245 _persistence = (ResourcePersistence)PortalBeanLocatorUtil.locate(ResourcePersistence.class.getName());
246 }
247
248 return _persistence;
249 }
250
251 public void setPersistence(ResourcePersistence persistence) {
252 _persistence = persistence;
253 }
254
255 private static ResourcePersistence _persistence;
256 }