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