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