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