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