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.Region;
022 import com.liferay.portal.service.ServiceContext;
023
024 import java.util.List;
025
026
032 public class RegionUtil {
033
036 public static void clearCache() {
037 getPersistence().clearCache();
038 }
039
040
043 public static void clearCache(Region region) {
044 getPersistence().clearCache(region);
045 }
046
047
050 public long countWithDynamicQuery(DynamicQuery dynamicQuery)
051 throws SystemException {
052 return getPersistence().countWithDynamicQuery(dynamicQuery);
053 }
054
055
058 public static List<Region> findWithDynamicQuery(DynamicQuery dynamicQuery)
059 throws SystemException {
060 return getPersistence().findWithDynamicQuery(dynamicQuery);
061 }
062
063
066 public static List<Region> findWithDynamicQuery(DynamicQuery dynamicQuery,
067 int start, int end) throws SystemException {
068 return getPersistence().findWithDynamicQuery(dynamicQuery, start, end);
069 }
070
071
074 public static List<Region> findWithDynamicQuery(DynamicQuery dynamicQuery,
075 int start, int end, OrderByComparator orderByComparator)
076 throws SystemException {
077 return getPersistence()
078 .findWithDynamicQuery(dynamicQuery, start, end,
079 orderByComparator);
080 }
081
082
085 public static Region remove(Region region) throws SystemException {
086 return getPersistence().remove(region);
087 }
088
089
092 public static Region update(Region region, boolean merge)
093 throws SystemException {
094 return getPersistence().update(region, merge);
095 }
096
097
100 public static Region update(Region region, boolean merge,
101 ServiceContext serviceContext) throws SystemException {
102 return getPersistence().update(region, merge, serviceContext);
103 }
104
105 public static void cacheResult(com.liferay.portal.model.Region region) {
106 getPersistence().cacheResult(region);
107 }
108
109 public static void cacheResult(
110 java.util.List<com.liferay.portal.model.Region> regions) {
111 getPersistence().cacheResult(regions);
112 }
113
114 public static com.liferay.portal.model.Region create(long regionId) {
115 return getPersistence().create(regionId);
116 }
117
118 public static com.liferay.portal.model.Region remove(long regionId)
119 throws com.liferay.portal.NoSuchRegionException,
120 com.liferay.portal.kernel.exception.SystemException {
121 return getPersistence().remove(regionId);
122 }
123
124 public static com.liferay.portal.model.Region updateImpl(
125 com.liferay.portal.model.Region region, boolean merge)
126 throws com.liferay.portal.kernel.exception.SystemException {
127 return getPersistence().updateImpl(region, merge);
128 }
129
130 public static com.liferay.portal.model.Region findByPrimaryKey(
131 long regionId)
132 throws com.liferay.portal.NoSuchRegionException,
133 com.liferay.portal.kernel.exception.SystemException {
134 return getPersistence().findByPrimaryKey(regionId);
135 }
136
137 public static com.liferay.portal.model.Region fetchByPrimaryKey(
138 long regionId)
139 throws com.liferay.portal.kernel.exception.SystemException {
140 return getPersistence().fetchByPrimaryKey(regionId);
141 }
142
143 public static java.util.List<com.liferay.portal.model.Region> findByCountryId(
144 long countryId)
145 throws com.liferay.portal.kernel.exception.SystemException {
146 return getPersistence().findByCountryId(countryId);
147 }
148
149 public static java.util.List<com.liferay.portal.model.Region> findByCountryId(
150 long countryId, int start, int end)
151 throws com.liferay.portal.kernel.exception.SystemException {
152 return getPersistence().findByCountryId(countryId, start, end);
153 }
154
155 public static java.util.List<com.liferay.portal.model.Region> findByCountryId(
156 long countryId, int start, int end,
157 com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
158 throws com.liferay.portal.kernel.exception.SystemException {
159 return getPersistence()
160 .findByCountryId(countryId, start, end, orderByComparator);
161 }
162
163 public static com.liferay.portal.model.Region findByCountryId_First(
164 long countryId,
165 com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
166 throws com.liferay.portal.NoSuchRegionException,
167 com.liferay.portal.kernel.exception.SystemException {
168 return getPersistence()
169 .findByCountryId_First(countryId, orderByComparator);
170 }
171
172 public static com.liferay.portal.model.Region findByCountryId_Last(
173 long countryId,
174 com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
175 throws com.liferay.portal.NoSuchRegionException,
176 com.liferay.portal.kernel.exception.SystemException {
177 return getPersistence()
178 .findByCountryId_Last(countryId, orderByComparator);
179 }
180
181 public static com.liferay.portal.model.Region[] findByCountryId_PrevAndNext(
182 long regionId, long countryId,
183 com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
184 throws com.liferay.portal.NoSuchRegionException,
185 com.liferay.portal.kernel.exception.SystemException {
186 return getPersistence()
187 .findByCountryId_PrevAndNext(regionId, countryId,
188 orderByComparator);
189 }
190
191 public static java.util.List<com.liferay.portal.model.Region> findByActive(
192 boolean active)
193 throws com.liferay.portal.kernel.exception.SystemException {
194 return getPersistence().findByActive(active);
195 }
196
197 public static java.util.List<com.liferay.portal.model.Region> findByActive(
198 boolean active, int start, int end)
199 throws com.liferay.portal.kernel.exception.SystemException {
200 return getPersistence().findByActive(active, start, end);
201 }
202
203 public static java.util.List<com.liferay.portal.model.Region> findByActive(
204 boolean active, int start, int end,
205 com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
206 throws com.liferay.portal.kernel.exception.SystemException {
207 return getPersistence()
208 .findByActive(active, start, end, orderByComparator);
209 }
210
211 public static com.liferay.portal.model.Region findByActive_First(
212 boolean active,
213 com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
214 throws com.liferay.portal.NoSuchRegionException,
215 com.liferay.portal.kernel.exception.SystemException {
216 return getPersistence().findByActive_First(active, orderByComparator);
217 }
218
219 public static com.liferay.portal.model.Region findByActive_Last(
220 boolean active,
221 com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
222 throws com.liferay.portal.NoSuchRegionException,
223 com.liferay.portal.kernel.exception.SystemException {
224 return getPersistence().findByActive_Last(active, orderByComparator);
225 }
226
227 public static com.liferay.portal.model.Region[] findByActive_PrevAndNext(
228 long regionId, boolean active,
229 com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
230 throws com.liferay.portal.NoSuchRegionException,
231 com.liferay.portal.kernel.exception.SystemException {
232 return getPersistence()
233 .findByActive_PrevAndNext(regionId, active, orderByComparator);
234 }
235
236 public static java.util.List<com.liferay.portal.model.Region> findByC_A(
237 long countryId, boolean active)
238 throws com.liferay.portal.kernel.exception.SystemException {
239 return getPersistence().findByC_A(countryId, active);
240 }
241
242 public static java.util.List<com.liferay.portal.model.Region> findByC_A(
243 long countryId, boolean active, int start, int end)
244 throws com.liferay.portal.kernel.exception.SystemException {
245 return getPersistence().findByC_A(countryId, active, start, end);
246 }
247
248 public static java.util.List<com.liferay.portal.model.Region> findByC_A(
249 long countryId, boolean active, int start, int end,
250 com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
251 throws com.liferay.portal.kernel.exception.SystemException {
252 return getPersistence()
253 .findByC_A(countryId, active, start, end, orderByComparator);
254 }
255
256 public static com.liferay.portal.model.Region findByC_A_First(
257 long countryId, boolean active,
258 com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
259 throws com.liferay.portal.NoSuchRegionException,
260 com.liferay.portal.kernel.exception.SystemException {
261 return getPersistence()
262 .findByC_A_First(countryId, active, orderByComparator);
263 }
264
265 public static com.liferay.portal.model.Region findByC_A_Last(
266 long countryId, boolean active,
267 com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
268 throws com.liferay.portal.NoSuchRegionException,
269 com.liferay.portal.kernel.exception.SystemException {
270 return getPersistence()
271 .findByC_A_Last(countryId, active, orderByComparator);
272 }
273
274 public static com.liferay.portal.model.Region[] findByC_A_PrevAndNext(
275 long regionId, long countryId, boolean active,
276 com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
277 throws com.liferay.portal.NoSuchRegionException,
278 com.liferay.portal.kernel.exception.SystemException {
279 return getPersistence()
280 .findByC_A_PrevAndNext(regionId, countryId, active,
281 orderByComparator);
282 }
283
284 public static java.util.List<com.liferay.portal.model.Region> findAll()
285 throws com.liferay.portal.kernel.exception.SystemException {
286 return getPersistence().findAll();
287 }
288
289 public static java.util.List<com.liferay.portal.model.Region> findAll(
290 int start, int end)
291 throws com.liferay.portal.kernel.exception.SystemException {
292 return getPersistence().findAll(start, end);
293 }
294
295 public static java.util.List<com.liferay.portal.model.Region> findAll(
296 int start, int end,
297 com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
298 throws com.liferay.portal.kernel.exception.SystemException {
299 return getPersistence().findAll(start, end, orderByComparator);
300 }
301
302 public static void removeByCountryId(long countryId)
303 throws com.liferay.portal.kernel.exception.SystemException {
304 getPersistence().removeByCountryId(countryId);
305 }
306
307 public static void removeByActive(boolean active)
308 throws com.liferay.portal.kernel.exception.SystemException {
309 getPersistence().removeByActive(active);
310 }
311
312 public static void removeByC_A(long countryId, boolean active)
313 throws com.liferay.portal.kernel.exception.SystemException {
314 getPersistence().removeByC_A(countryId, active);
315 }
316
317 public static void removeAll()
318 throws com.liferay.portal.kernel.exception.SystemException {
319 getPersistence().removeAll();
320 }
321
322 public static int countByCountryId(long countryId)
323 throws com.liferay.portal.kernel.exception.SystemException {
324 return getPersistence().countByCountryId(countryId);
325 }
326
327 public static int countByActive(boolean active)
328 throws com.liferay.portal.kernel.exception.SystemException {
329 return getPersistence().countByActive(active);
330 }
331
332 public static int countByC_A(long countryId, boolean active)
333 throws com.liferay.portal.kernel.exception.SystemException {
334 return getPersistence().countByC_A(countryId, active);
335 }
336
337 public static int countAll()
338 throws com.liferay.portal.kernel.exception.SystemException {
339 return getPersistence().countAll();
340 }
341
342 public static RegionPersistence getPersistence() {
343 if (_persistence == null) {
344 _persistence = (RegionPersistence)PortalBeanLocatorUtil.locate(RegionPersistence.class.getName());
345 }
346
347 return _persistence;
348 }
349
350 public void setPersistence(RegionPersistence persistence) {
351 _persistence = persistence;
352 }
353
354 private static RegionPersistence _persistence;
355 }