001    /**
002     * Copyright (c) 2000-2012 Liferay, Inc. All rights reserved.
003     *
004     * This library is free software; you can redistribute it and/or modify it under
005     * the terms of the GNU Lesser General Public License as published by the Free
006     * Software Foundation; either version 2.1 of the License, or (at your option)
007     * any later version.
008     *
009     * This library is distributed in the hope that it will be useful, but WITHOUT
010     * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
011     * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
012     * details.
013     */
014    
015    package com.liferay.portal.service.persistence;
016    
017    import com.liferay.portal.model.Region;
018    
019    /**
020     * The persistence interface for the region service.
021     *
022     * <p>
023     * Caching information and settings can be found in <code>portal.properties</code>
024     * </p>
025     *
026     * @author Brian Wing Shun Chan
027     * @see RegionPersistenceImpl
028     * @see RegionUtil
029     * @generated
030     */
031    public interface RegionPersistence extends BasePersistence<Region> {
032            /*
033             * NOTE FOR DEVELOPERS:
034             *
035             * Never modify or reference this interface directly. Always use {@link RegionUtil} to access the region persistence. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this interface.
036             */
037    
038            /**
039            * Returns all the regions where countryId = &#63;.
040            *
041            * @param countryId the country ID
042            * @return the matching regions
043            * @throws SystemException if a system exception occurred
044            */
045            public java.util.List<com.liferay.portal.model.Region> findByCountryId(
046                    long countryId)
047                    throws com.liferay.portal.kernel.exception.SystemException;
048    
049            /**
050            * Returns a range of all the regions where countryId = &#63;.
051            *
052            * <p>
053            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.RegionModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
054            * </p>
055            *
056            * @param countryId the country ID
057            * @param start the lower bound of the range of regions
058            * @param end the upper bound of the range of regions (not inclusive)
059            * @return the range of matching regions
060            * @throws SystemException if a system exception occurred
061            */
062            public java.util.List<com.liferay.portal.model.Region> findByCountryId(
063                    long countryId, int start, int end)
064                    throws com.liferay.portal.kernel.exception.SystemException;
065    
066            /**
067            * Returns an ordered range of all the regions where countryId = &#63;.
068            *
069            * <p>
070            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.RegionModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
071            * </p>
072            *
073            * @param countryId the country ID
074            * @param start the lower bound of the range of regions
075            * @param end the upper bound of the range of regions (not inclusive)
076            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
077            * @return the ordered range of matching regions
078            * @throws SystemException if a system exception occurred
079            */
080            public java.util.List<com.liferay.portal.model.Region> findByCountryId(
081                    long countryId, int start, int end,
082                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
083                    throws com.liferay.portal.kernel.exception.SystemException;
084    
085            /**
086            * Returns the first region in the ordered set where countryId = &#63;.
087            *
088            * @param countryId the country ID
089            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
090            * @return the first matching region
091            * @throws com.liferay.portal.NoSuchRegionException if a matching region could not be found
092            * @throws SystemException if a system exception occurred
093            */
094            public com.liferay.portal.model.Region findByCountryId_First(
095                    long countryId,
096                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
097                    throws com.liferay.portal.NoSuchRegionException,
098                            com.liferay.portal.kernel.exception.SystemException;
099    
100            /**
101            * Returns the first region in the ordered set where countryId = &#63;.
102            *
103            * @param countryId the country ID
104            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
105            * @return the first matching region, or <code>null</code> if a matching region could not be found
106            * @throws SystemException if a system exception occurred
107            */
108            public com.liferay.portal.model.Region fetchByCountryId_First(
109                    long countryId,
110                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
111                    throws com.liferay.portal.kernel.exception.SystemException;
112    
113            /**
114            * Returns the last region in the ordered set where countryId = &#63;.
115            *
116            * @param countryId the country ID
117            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
118            * @return the last matching region
119            * @throws com.liferay.portal.NoSuchRegionException if a matching region could not be found
120            * @throws SystemException if a system exception occurred
121            */
122            public com.liferay.portal.model.Region findByCountryId_Last(
123                    long countryId,
124                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
125                    throws com.liferay.portal.NoSuchRegionException,
126                            com.liferay.portal.kernel.exception.SystemException;
127    
128            /**
129            * Returns the last region in the ordered set where countryId = &#63;.
130            *
131            * @param countryId the country ID
132            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
133            * @return the last matching region, or <code>null</code> if a matching region could not be found
134            * @throws SystemException if a system exception occurred
135            */
136            public com.liferay.portal.model.Region fetchByCountryId_Last(
137                    long countryId,
138                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
139                    throws com.liferay.portal.kernel.exception.SystemException;
140    
141            /**
142            * Returns the regions before and after the current region in the ordered set where countryId = &#63;.
143            *
144            * @param regionId the primary key of the current region
145            * @param countryId the country ID
146            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
147            * @return the previous, current, and next region
148            * @throws com.liferay.portal.NoSuchRegionException if a region with the primary key could not be found
149            * @throws SystemException if a system exception occurred
150            */
151            public com.liferay.portal.model.Region[] findByCountryId_PrevAndNext(
152                    long regionId, long countryId,
153                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
154                    throws com.liferay.portal.NoSuchRegionException,
155                            com.liferay.portal.kernel.exception.SystemException;
156    
157            /**
158            * Removes all the regions where countryId = &#63; from the database.
159            *
160            * @param countryId the country ID
161            * @throws SystemException if a system exception occurred
162            */
163            public void removeByCountryId(long countryId)
164                    throws com.liferay.portal.kernel.exception.SystemException;
165    
166            /**
167            * Returns the number of regions where countryId = &#63;.
168            *
169            * @param countryId the country ID
170            * @return the number of matching regions
171            * @throws SystemException if a system exception occurred
172            */
173            public int countByCountryId(long countryId)
174                    throws com.liferay.portal.kernel.exception.SystemException;
175    
176            /**
177            * Returns all the regions where active = &#63;.
178            *
179            * @param active the active
180            * @return the matching regions
181            * @throws SystemException if a system exception occurred
182            */
183            public java.util.List<com.liferay.portal.model.Region> findByActive(
184                    boolean active)
185                    throws com.liferay.portal.kernel.exception.SystemException;
186    
187            /**
188            * Returns a range of all the regions where active = &#63;.
189            *
190            * <p>
191            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.RegionModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
192            * </p>
193            *
194            * @param active the active
195            * @param start the lower bound of the range of regions
196            * @param end the upper bound of the range of regions (not inclusive)
197            * @return the range of matching regions
198            * @throws SystemException if a system exception occurred
199            */
200            public java.util.List<com.liferay.portal.model.Region> findByActive(
201                    boolean active, int start, int end)
202                    throws com.liferay.portal.kernel.exception.SystemException;
203    
204            /**
205            * Returns an ordered range of all the regions where active = &#63;.
206            *
207            * <p>
208            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.RegionModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
209            * </p>
210            *
211            * @param active the active
212            * @param start the lower bound of the range of regions
213            * @param end the upper bound of the range of regions (not inclusive)
214            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
215            * @return the ordered range of matching regions
216            * @throws SystemException if a system exception occurred
217            */
218            public java.util.List<com.liferay.portal.model.Region> findByActive(
219                    boolean active, int start, int end,
220                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
221                    throws com.liferay.portal.kernel.exception.SystemException;
222    
223            /**
224            * Returns the first region in the ordered set where active = &#63;.
225            *
226            * @param active the active
227            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
228            * @return the first matching region
229            * @throws com.liferay.portal.NoSuchRegionException if a matching region could not be found
230            * @throws SystemException if a system exception occurred
231            */
232            public com.liferay.portal.model.Region findByActive_First(boolean active,
233                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
234                    throws com.liferay.portal.NoSuchRegionException,
235                            com.liferay.portal.kernel.exception.SystemException;
236    
237            /**
238            * Returns the first region in the ordered set where active = &#63;.
239            *
240            * @param active the active
241            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
242            * @return the first matching region, or <code>null</code> if a matching region could not be found
243            * @throws SystemException if a system exception occurred
244            */
245            public com.liferay.portal.model.Region fetchByActive_First(boolean active,
246                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
247                    throws com.liferay.portal.kernel.exception.SystemException;
248    
249            /**
250            * Returns the last region in the ordered set where active = &#63;.
251            *
252            * @param active the active
253            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
254            * @return the last matching region
255            * @throws com.liferay.portal.NoSuchRegionException if a matching region could not be found
256            * @throws SystemException if a system exception occurred
257            */
258            public com.liferay.portal.model.Region findByActive_Last(boolean active,
259                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
260                    throws com.liferay.portal.NoSuchRegionException,
261                            com.liferay.portal.kernel.exception.SystemException;
262    
263            /**
264            * Returns the last region in the ordered set where active = &#63;.
265            *
266            * @param active the active
267            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
268            * @return the last matching region, or <code>null</code> if a matching region could not be found
269            * @throws SystemException if a system exception occurred
270            */
271            public com.liferay.portal.model.Region fetchByActive_Last(boolean active,
272                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
273                    throws com.liferay.portal.kernel.exception.SystemException;
274    
275            /**
276            * Returns the regions before and after the current region in the ordered set where active = &#63;.
277            *
278            * @param regionId the primary key of the current region
279            * @param active the active
280            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
281            * @return the previous, current, and next region
282            * @throws com.liferay.portal.NoSuchRegionException if a region with the primary key could not be found
283            * @throws SystemException if a system exception occurred
284            */
285            public com.liferay.portal.model.Region[] findByActive_PrevAndNext(
286                    long regionId, boolean active,
287                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
288                    throws com.liferay.portal.NoSuchRegionException,
289                            com.liferay.portal.kernel.exception.SystemException;
290    
291            /**
292            * Removes all the regions where active = &#63; from the database.
293            *
294            * @param active the active
295            * @throws SystemException if a system exception occurred
296            */
297            public void removeByActive(boolean active)
298                    throws com.liferay.portal.kernel.exception.SystemException;
299    
300            /**
301            * Returns the number of regions where active = &#63;.
302            *
303            * @param active the active
304            * @return the number of matching regions
305            * @throws SystemException if a system exception occurred
306            */
307            public int countByActive(boolean active)
308                    throws com.liferay.portal.kernel.exception.SystemException;
309    
310            /**
311            * Returns the region where countryId = &#63; and regionCode = &#63; or throws a {@link com.liferay.portal.NoSuchRegionException} if it could not be found.
312            *
313            * @param countryId the country ID
314            * @param regionCode the region code
315            * @return the matching region
316            * @throws com.liferay.portal.NoSuchRegionException if a matching region could not be found
317            * @throws SystemException if a system exception occurred
318            */
319            public com.liferay.portal.model.Region findByC_R(long countryId,
320                    java.lang.String regionCode)
321                    throws com.liferay.portal.NoSuchRegionException,
322                            com.liferay.portal.kernel.exception.SystemException;
323    
324            /**
325            * Returns the region where countryId = &#63; and regionCode = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
326            *
327            * @param countryId the country ID
328            * @param regionCode the region code
329            * @return the matching region, or <code>null</code> if a matching region could not be found
330            * @throws SystemException if a system exception occurred
331            */
332            public com.liferay.portal.model.Region fetchByC_R(long countryId,
333                    java.lang.String regionCode)
334                    throws com.liferay.portal.kernel.exception.SystemException;
335    
336            /**
337            * Returns the region where countryId = &#63; and regionCode = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
338            *
339            * @param countryId the country ID
340            * @param regionCode the region code
341            * @param retrieveFromCache whether to use the finder cache
342            * @return the matching region, or <code>null</code> if a matching region could not be found
343            * @throws SystemException if a system exception occurred
344            */
345            public com.liferay.portal.model.Region fetchByC_R(long countryId,
346                    java.lang.String regionCode, boolean retrieveFromCache)
347                    throws com.liferay.portal.kernel.exception.SystemException;
348    
349            /**
350            * Removes the region where countryId = &#63; and regionCode = &#63; from the database.
351            *
352            * @param countryId the country ID
353            * @param regionCode the region code
354            * @return the region that was removed
355            * @throws SystemException if a system exception occurred
356            */
357            public com.liferay.portal.model.Region removeByC_R(long countryId,
358                    java.lang.String regionCode)
359                    throws com.liferay.portal.NoSuchRegionException,
360                            com.liferay.portal.kernel.exception.SystemException;
361    
362            /**
363            * Returns the number of regions where countryId = &#63; and regionCode = &#63;.
364            *
365            * @param countryId the country ID
366            * @param regionCode the region code
367            * @return the number of matching regions
368            * @throws SystemException if a system exception occurred
369            */
370            public int countByC_R(long countryId, java.lang.String regionCode)
371                    throws com.liferay.portal.kernel.exception.SystemException;
372    
373            /**
374            * Returns all the regions where countryId = &#63; and active = &#63;.
375            *
376            * @param countryId the country ID
377            * @param active the active
378            * @return the matching regions
379            * @throws SystemException if a system exception occurred
380            */
381            public java.util.List<com.liferay.portal.model.Region> findByC_A(
382                    long countryId, boolean active)
383                    throws com.liferay.portal.kernel.exception.SystemException;
384    
385            /**
386            * Returns a range of all the regions where countryId = &#63; and active = &#63;.
387            *
388            * <p>
389            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.RegionModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
390            * </p>
391            *
392            * @param countryId the country ID
393            * @param active the active
394            * @param start the lower bound of the range of regions
395            * @param end the upper bound of the range of regions (not inclusive)
396            * @return the range of matching regions
397            * @throws SystemException if a system exception occurred
398            */
399            public java.util.List<com.liferay.portal.model.Region> findByC_A(
400                    long countryId, boolean active, int start, int end)
401                    throws com.liferay.portal.kernel.exception.SystemException;
402    
403            /**
404            * Returns an ordered range of all the regions where countryId = &#63; and active = &#63;.
405            *
406            * <p>
407            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.RegionModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
408            * </p>
409            *
410            * @param countryId the country ID
411            * @param active the active
412            * @param start the lower bound of the range of regions
413            * @param end the upper bound of the range of regions (not inclusive)
414            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
415            * @return the ordered range of matching regions
416            * @throws SystemException if a system exception occurred
417            */
418            public java.util.List<com.liferay.portal.model.Region> findByC_A(
419                    long countryId, boolean active, int start, int end,
420                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
421                    throws com.liferay.portal.kernel.exception.SystemException;
422    
423            /**
424            * Returns the first region in the ordered set where countryId = &#63; and active = &#63;.
425            *
426            * @param countryId the country ID
427            * @param active the active
428            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
429            * @return the first matching region
430            * @throws com.liferay.portal.NoSuchRegionException if a matching region could not be found
431            * @throws SystemException if a system exception occurred
432            */
433            public com.liferay.portal.model.Region findByC_A_First(long countryId,
434                    boolean active,
435                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
436                    throws com.liferay.portal.NoSuchRegionException,
437                            com.liferay.portal.kernel.exception.SystemException;
438    
439            /**
440            * Returns the first region in the ordered set where countryId = &#63; and active = &#63;.
441            *
442            * @param countryId the country ID
443            * @param active the active
444            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
445            * @return the first matching region, or <code>null</code> if a matching region could not be found
446            * @throws SystemException if a system exception occurred
447            */
448            public com.liferay.portal.model.Region fetchByC_A_First(long countryId,
449                    boolean active,
450                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
451                    throws com.liferay.portal.kernel.exception.SystemException;
452    
453            /**
454            * Returns the last region in the ordered set where countryId = &#63; and active = &#63;.
455            *
456            * @param countryId the country ID
457            * @param active the active
458            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
459            * @return the last matching region
460            * @throws com.liferay.portal.NoSuchRegionException if a matching region could not be found
461            * @throws SystemException if a system exception occurred
462            */
463            public com.liferay.portal.model.Region findByC_A_Last(long countryId,
464                    boolean active,
465                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
466                    throws com.liferay.portal.NoSuchRegionException,
467                            com.liferay.portal.kernel.exception.SystemException;
468    
469            /**
470            * Returns the last region in the ordered set where countryId = &#63; and active = &#63;.
471            *
472            * @param countryId the country ID
473            * @param active the active
474            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
475            * @return the last matching region, or <code>null</code> if a matching region could not be found
476            * @throws SystemException if a system exception occurred
477            */
478            public com.liferay.portal.model.Region fetchByC_A_Last(long countryId,
479                    boolean active,
480                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
481                    throws com.liferay.portal.kernel.exception.SystemException;
482    
483            /**
484            * Returns the regions before and after the current region in the ordered set where countryId = &#63; and active = &#63;.
485            *
486            * @param regionId the primary key of the current region
487            * @param countryId the country ID
488            * @param active the active
489            * @param orderByComparator the comparator to order the set by (optionally <code>null</code>)
490            * @return the previous, current, and next region
491            * @throws com.liferay.portal.NoSuchRegionException if a region with the primary key could not be found
492            * @throws SystemException if a system exception occurred
493            */
494            public com.liferay.portal.model.Region[] findByC_A_PrevAndNext(
495                    long regionId, long countryId, boolean active,
496                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
497                    throws com.liferay.portal.NoSuchRegionException,
498                            com.liferay.portal.kernel.exception.SystemException;
499    
500            /**
501            * Removes all the regions where countryId = &#63; and active = &#63; from the database.
502            *
503            * @param countryId the country ID
504            * @param active the active
505            * @throws SystemException if a system exception occurred
506            */
507            public void removeByC_A(long countryId, boolean active)
508                    throws com.liferay.portal.kernel.exception.SystemException;
509    
510            /**
511            * Returns the number of regions where countryId = &#63; and active = &#63;.
512            *
513            * @param countryId the country ID
514            * @param active the active
515            * @return the number of matching regions
516            * @throws SystemException if a system exception occurred
517            */
518            public int countByC_A(long countryId, boolean active)
519                    throws com.liferay.portal.kernel.exception.SystemException;
520    
521            /**
522            * Caches the region in the entity cache if it is enabled.
523            *
524            * @param region the region
525            */
526            public void cacheResult(com.liferay.portal.model.Region region);
527    
528            /**
529            * Caches the regions in the entity cache if it is enabled.
530            *
531            * @param regions the regions
532            */
533            public void cacheResult(
534                    java.util.List<com.liferay.portal.model.Region> regions);
535    
536            /**
537            * Creates a new region with the primary key. Does not add the region to the database.
538            *
539            * @param regionId the primary key for the new region
540            * @return the new region
541            */
542            public com.liferay.portal.model.Region create(long regionId);
543    
544            /**
545            * Removes the region with the primary key from the database. Also notifies the appropriate model listeners.
546            *
547            * @param regionId the primary key of the region
548            * @return the region that was removed
549            * @throws com.liferay.portal.NoSuchRegionException if a region with the primary key could not be found
550            * @throws SystemException if a system exception occurred
551            */
552            public com.liferay.portal.model.Region remove(long regionId)
553                    throws com.liferay.portal.NoSuchRegionException,
554                            com.liferay.portal.kernel.exception.SystemException;
555    
556            public com.liferay.portal.model.Region updateImpl(
557                    com.liferay.portal.model.Region region)
558                    throws com.liferay.portal.kernel.exception.SystemException;
559    
560            /**
561            * Returns the region with the primary key or throws a {@link com.liferay.portal.NoSuchRegionException} if it could not be found.
562            *
563            * @param regionId the primary key of the region
564            * @return the region
565            * @throws com.liferay.portal.NoSuchRegionException if a region with the primary key could not be found
566            * @throws SystemException if a system exception occurred
567            */
568            public com.liferay.portal.model.Region findByPrimaryKey(long regionId)
569                    throws com.liferay.portal.NoSuchRegionException,
570                            com.liferay.portal.kernel.exception.SystemException;
571    
572            /**
573            * Returns the region with the primary key or returns <code>null</code> if it could not be found.
574            *
575            * @param regionId the primary key of the region
576            * @return the region, or <code>null</code> if a region with the primary key could not be found
577            * @throws SystemException if a system exception occurred
578            */
579            public com.liferay.portal.model.Region fetchByPrimaryKey(long regionId)
580                    throws com.liferay.portal.kernel.exception.SystemException;
581    
582            /**
583            * Returns all the regions.
584            *
585            * @return the regions
586            * @throws SystemException if a system exception occurred
587            */
588            public java.util.List<com.liferay.portal.model.Region> findAll()
589                    throws com.liferay.portal.kernel.exception.SystemException;
590    
591            /**
592            * Returns a range of all the regions.
593            *
594            * <p>
595            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.RegionModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
596            * </p>
597            *
598            * @param start the lower bound of the range of regions
599            * @param end the upper bound of the range of regions (not inclusive)
600            * @return the range of regions
601            * @throws SystemException if a system exception occurred
602            */
603            public java.util.List<com.liferay.portal.model.Region> findAll(int start,
604                    int end) throws com.liferay.portal.kernel.exception.SystemException;
605    
606            /**
607            * Returns an ordered range of all the regions.
608            *
609            * <p>
610            * Useful when paginating results. Returns a maximum of <code>end - start</code> instances. <code>start</code> and <code>end</code> are not primary keys, they are indexes in the result set. Thus, <code>0</code> refers to the first result in the set. Setting both <code>start</code> and <code>end</code> to {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS} will return the full result set. If <code>orderByComparator</code> is specified, then the query will include the given ORDER BY logic. If <code>orderByComparator</code> is absent and pagination is required (<code>start</code> and <code>end</code> are not {@link com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS}), then the query will include the default ORDER BY logic from {@link com.liferay.portal.model.impl.RegionModelImpl}. If both <code>orderByComparator</code> and pagination are absent, for performance reasons, the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order.
611            * </p>
612            *
613            * @param start the lower bound of the range of regions
614            * @param end the upper bound of the range of regions (not inclusive)
615            * @param orderByComparator the comparator to order the results by (optionally <code>null</code>)
616            * @return the ordered range of regions
617            * @throws SystemException if a system exception occurred
618            */
619            public java.util.List<com.liferay.portal.model.Region> findAll(int start,
620                    int end,
621                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
622                    throws com.liferay.portal.kernel.exception.SystemException;
623    
624            /**
625            * Removes all the regions from the database.
626            *
627            * @throws SystemException if a system exception occurred
628            */
629            public void removeAll()
630                    throws com.liferay.portal.kernel.exception.SystemException;
631    
632            /**
633            * Returns the number of regions.
634            *
635            * @return the number of regions
636            * @throws SystemException if a system exception occurred
637            */
638            public int countAll()
639                    throws com.liferay.portal.kernel.exception.SystemException;
640    }