001    /**
002     * Copyright (c) 2000-2010 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.Country;
018    
019    /**
020     * The persistence interface for the country service.
021     *
022     * <p>
023     * Never modify or reference this interface directly. Always use {@link CountryUtil} to access the country persistence. Modify <code>service.xml</code> and rerun ServiceBuilder to regenerate this interface.
024     * </p>
025     *
026     * <p>
027     * Caching information and settings can be found in <code>portal.properties</code>
028     * </p>
029     *
030     * @author Brian Wing Shun Chan
031     * @see CountryPersistenceImpl
032     * @see CountryUtil
033     * @generated
034     */
035    public interface CountryPersistence extends BasePersistence<Country> {
036            /**
037            * Caches the country in the entity cache if it is enabled.
038            *
039            * @param country the country to cache
040            */
041            public void cacheResult(com.liferay.portal.model.Country country);
042    
043            /**
044            * Caches the countries in the entity cache if it is enabled.
045            *
046            * @param countries the countries to cache
047            */
048            public void cacheResult(
049                    java.util.List<com.liferay.portal.model.Country> countries);
050    
051            /**
052            * Creates a new country with the primary key. Does not add the country to the database.
053            *
054            * @param countryId the primary key for the new country
055            * @return the new country
056            */
057            public com.liferay.portal.model.Country create(long countryId);
058    
059            /**
060            * Removes the country with the primary key from the database. Also notifies the appropriate model listeners.
061            *
062            * @param countryId the primary key of the country to remove
063            * @return the country that was removed
064            * @throws com.liferay.portal.NoSuchCountryException if a country with the primary key could not be found
065            * @throws SystemException if a system exception occurred
066            */
067            public com.liferay.portal.model.Country remove(long countryId)
068                    throws com.liferay.portal.NoSuchCountryException,
069                            com.liferay.portal.kernel.exception.SystemException;
070    
071            public com.liferay.portal.model.Country updateImpl(
072                    com.liferay.portal.model.Country country, boolean merge)
073                    throws com.liferay.portal.kernel.exception.SystemException;
074    
075            /**
076            * Finds the country with the primary key or throws a {@link com.liferay.portal.NoSuchCountryException} if it could not be found.
077            *
078            * @param countryId the primary key of the country to find
079            * @return the country
080            * @throws com.liferay.portal.NoSuchCountryException if a country with the primary key could not be found
081            * @throws SystemException if a system exception occurred
082            */
083            public com.liferay.portal.model.Country findByPrimaryKey(long countryId)
084                    throws com.liferay.portal.NoSuchCountryException,
085                            com.liferay.portal.kernel.exception.SystemException;
086    
087            /**
088            * Finds the country with the primary key or returns <code>null</code> if it could not be found.
089            *
090            * @param countryId the primary key of the country to find
091            * @return the country, or <code>null</code> if a country with the primary key could not be found
092            * @throws SystemException if a system exception occurred
093            */
094            public com.liferay.portal.model.Country fetchByPrimaryKey(long countryId)
095                    throws com.liferay.portal.kernel.exception.SystemException;
096    
097            /**
098            * Finds the country where name = &#63; or throws a {@link com.liferay.portal.NoSuchCountryException} if it could not be found.
099            *
100            * @param name the name to search with
101            * @return the matching country
102            * @throws com.liferay.portal.NoSuchCountryException if a matching country could not be found
103            * @throws SystemException if a system exception occurred
104            */
105            public com.liferay.portal.model.Country findByName(java.lang.String name)
106                    throws com.liferay.portal.NoSuchCountryException,
107                            com.liferay.portal.kernel.exception.SystemException;
108    
109            /**
110            * Finds the country where name = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
111            *
112            * @param name the name to search with
113            * @return the matching country, or <code>null</code> if a matching country could not be found
114            * @throws SystemException if a system exception occurred
115            */
116            public com.liferay.portal.model.Country fetchByName(java.lang.String name)
117                    throws com.liferay.portal.kernel.exception.SystemException;
118    
119            /**
120            * Finds the country where name = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
121            *
122            * @param name the name to search with
123            * @return the matching country, or <code>null</code> if a matching country could not be found
124            * @throws SystemException if a system exception occurred
125            */
126            public com.liferay.portal.model.Country fetchByName(java.lang.String name,
127                    boolean retrieveFromCache)
128                    throws com.liferay.portal.kernel.exception.SystemException;
129    
130            /**
131            * Finds the country where a2 = &#63; or throws a {@link com.liferay.portal.NoSuchCountryException} if it could not be found.
132            *
133            * @param a2 the a2 to search with
134            * @return the matching country
135            * @throws com.liferay.portal.NoSuchCountryException if a matching country could not be found
136            * @throws SystemException if a system exception occurred
137            */
138            public com.liferay.portal.model.Country findByA2(java.lang.String a2)
139                    throws com.liferay.portal.NoSuchCountryException,
140                            com.liferay.portal.kernel.exception.SystemException;
141    
142            /**
143            * Finds the country where a2 = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
144            *
145            * @param a2 the a2 to search with
146            * @return the matching country, or <code>null</code> if a matching country could not be found
147            * @throws SystemException if a system exception occurred
148            */
149            public com.liferay.portal.model.Country fetchByA2(java.lang.String a2)
150                    throws com.liferay.portal.kernel.exception.SystemException;
151    
152            /**
153            * Finds the country where a2 = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
154            *
155            * @param a2 the a2 to search with
156            * @return the matching country, or <code>null</code> if a matching country could not be found
157            * @throws SystemException if a system exception occurred
158            */
159            public com.liferay.portal.model.Country fetchByA2(java.lang.String a2,
160                    boolean retrieveFromCache)
161                    throws com.liferay.portal.kernel.exception.SystemException;
162    
163            /**
164            * Finds the country where a3 = &#63; or throws a {@link com.liferay.portal.NoSuchCountryException} if it could not be found.
165            *
166            * @param a3 the a3 to search with
167            * @return the matching country
168            * @throws com.liferay.portal.NoSuchCountryException if a matching country could not be found
169            * @throws SystemException if a system exception occurred
170            */
171            public com.liferay.portal.model.Country findByA3(java.lang.String a3)
172                    throws com.liferay.portal.NoSuchCountryException,
173                            com.liferay.portal.kernel.exception.SystemException;
174    
175            /**
176            * Finds the country where a3 = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
177            *
178            * @param a3 the a3 to search with
179            * @return the matching country, or <code>null</code> if a matching country could not be found
180            * @throws SystemException if a system exception occurred
181            */
182            public com.liferay.portal.model.Country fetchByA3(java.lang.String a3)
183                    throws com.liferay.portal.kernel.exception.SystemException;
184    
185            /**
186            * Finds the country where a3 = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
187            *
188            * @param a3 the a3 to search with
189            * @return the matching country, or <code>null</code> if a matching country could not be found
190            * @throws SystemException if a system exception occurred
191            */
192            public com.liferay.portal.model.Country fetchByA3(java.lang.String a3,
193                    boolean retrieveFromCache)
194                    throws com.liferay.portal.kernel.exception.SystemException;
195    
196            /**
197            * Finds all the countries where active = &#63;.
198            *
199            * @param active the active to search with
200            * @return the matching countries
201            * @throws SystemException if a system exception occurred
202            */
203            public java.util.List<com.liferay.portal.model.Country> findByActive(
204                    boolean active)
205                    throws com.liferay.portal.kernel.exception.SystemException;
206    
207            /**
208            * Finds a range of all the countries 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.
212            * </p>
213            *
214            * @param active the active to search with
215            * @param start the lower bound of the range of countries to return
216            * @param end the upper bound of the range of countries to return (not inclusive)
217            * @return the range of matching countries
218            * @throws SystemException if a system exception occurred
219            */
220            public java.util.List<com.liferay.portal.model.Country> findByActive(
221                    boolean active, int start, int end)
222                    throws com.liferay.portal.kernel.exception.SystemException;
223    
224            /**
225            * Finds an ordered range of all the countries where active = &#63;.
226            *
227            * <p>
228            * 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.
229            * </p>
230            *
231            * @param active the active to search with
232            * @param start the lower bound of the range of countries to return
233            * @param end the upper bound of the range of countries to return (not inclusive)
234            * @param orderByComparator the comparator to order the results by
235            * @return the ordered range of matching countries
236            * @throws SystemException if a system exception occurred
237            */
238            public java.util.List<com.liferay.portal.model.Country> findByActive(
239                    boolean active, int start, int end,
240                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
241                    throws com.liferay.portal.kernel.exception.SystemException;
242    
243            /**
244            * Finds the first country in the ordered set where active = &#63;.
245            *
246            * <p>
247            * 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.
248            * </p>
249            *
250            * @param active the active to search with
251            * @param orderByComparator the comparator to order the set by
252            * @return the first matching country
253            * @throws com.liferay.portal.NoSuchCountryException if a matching country could not be found
254            * @throws SystemException if a system exception occurred
255            */
256            public com.liferay.portal.model.Country findByActive_First(boolean active,
257                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
258                    throws com.liferay.portal.NoSuchCountryException,
259                            com.liferay.portal.kernel.exception.SystemException;
260    
261            /**
262            * Finds the last country in the ordered set where active = &#63;.
263            *
264            * <p>
265            * 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.
266            * </p>
267            *
268            * @param active the active to search with
269            * @param orderByComparator the comparator to order the set by
270            * @return the last matching country
271            * @throws com.liferay.portal.NoSuchCountryException if a matching country could not be found
272            * @throws SystemException if a system exception occurred
273            */
274            public com.liferay.portal.model.Country findByActive_Last(boolean active,
275                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
276                    throws com.liferay.portal.NoSuchCountryException,
277                            com.liferay.portal.kernel.exception.SystemException;
278    
279            /**
280            * Finds the countries before and after the current country in the ordered set where active = &#63;.
281            *
282            * <p>
283            * 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.
284            * </p>
285            *
286            * @param countryId the primary key of the current country
287            * @param active the active to search with
288            * @param orderByComparator the comparator to order the set by
289            * @return the previous, current, and next country
290            * @throws com.liferay.portal.NoSuchCountryException if a country with the primary key could not be found
291            * @throws SystemException if a system exception occurred
292            */
293            public com.liferay.portal.model.Country[] findByActive_PrevAndNext(
294                    long countryId, boolean active,
295                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
296                    throws com.liferay.portal.NoSuchCountryException,
297                            com.liferay.portal.kernel.exception.SystemException;
298    
299            /**
300            * Finds all the countries.
301            *
302            * @return the countries
303            * @throws SystemException if a system exception occurred
304            */
305            public java.util.List<com.liferay.portal.model.Country> findAll()
306                    throws com.liferay.portal.kernel.exception.SystemException;
307    
308            /**
309            * Finds a range of all the countries.
310            *
311            * <p>
312            * 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.
313            * </p>
314            *
315            * @param start the lower bound of the range of countries to return
316            * @param end the upper bound of the range of countries to return (not inclusive)
317            * @return the range of countries
318            * @throws SystemException if a system exception occurred
319            */
320            public java.util.List<com.liferay.portal.model.Country> findAll(int start,
321                    int end) throws com.liferay.portal.kernel.exception.SystemException;
322    
323            /**
324            * Finds an ordered range of all the countries.
325            *
326            * <p>
327            * 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.
328            * </p>
329            *
330            * @param start the lower bound of the range of countries to return
331            * @param end the upper bound of the range of countries to return (not inclusive)
332            * @param orderByComparator the comparator to order the results by
333            * @return the ordered range of countries
334            * @throws SystemException if a system exception occurred
335            */
336            public java.util.List<com.liferay.portal.model.Country> findAll(int start,
337                    int end,
338                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
339                    throws com.liferay.portal.kernel.exception.SystemException;
340    
341            /**
342            * Removes the country where name = &#63; from the database.
343            *
344            * @param name the name to search with
345            * @throws SystemException if a system exception occurred
346            */
347            public void removeByName(java.lang.String name)
348                    throws com.liferay.portal.NoSuchCountryException,
349                            com.liferay.portal.kernel.exception.SystemException;
350    
351            /**
352            * Removes the country where a2 = &#63; from the database.
353            *
354            * @param a2 the a2 to search with
355            * @throws SystemException if a system exception occurred
356            */
357            public void removeByA2(java.lang.String a2)
358                    throws com.liferay.portal.NoSuchCountryException,
359                            com.liferay.portal.kernel.exception.SystemException;
360    
361            /**
362            * Removes the country where a3 = &#63; from the database.
363            *
364            * @param a3 the a3 to search with
365            * @throws SystemException if a system exception occurred
366            */
367            public void removeByA3(java.lang.String a3)
368                    throws com.liferay.portal.NoSuchCountryException,
369                            com.liferay.portal.kernel.exception.SystemException;
370    
371            /**
372            * Removes all the countries where active = &#63; from the database.
373            *
374            * @param active the active to search with
375            * @throws SystemException if a system exception occurred
376            */
377            public void removeByActive(boolean active)
378                    throws com.liferay.portal.kernel.exception.SystemException;
379    
380            /**
381            * Removes all the countries from the database.
382            *
383            * @throws SystemException if a system exception occurred
384            */
385            public void removeAll()
386                    throws com.liferay.portal.kernel.exception.SystemException;
387    
388            /**
389            * Counts all the countries where name = &#63;.
390            *
391            * @param name the name to search with
392            * @return the number of matching countries
393            * @throws SystemException if a system exception occurred
394            */
395            public int countByName(java.lang.String name)
396                    throws com.liferay.portal.kernel.exception.SystemException;
397    
398            /**
399            * Counts all the countries where a2 = &#63;.
400            *
401            * @param a2 the a2 to search with
402            * @return the number of matching countries
403            * @throws SystemException if a system exception occurred
404            */
405            public int countByA2(java.lang.String a2)
406                    throws com.liferay.portal.kernel.exception.SystemException;
407    
408            /**
409            * Counts all the countries where a3 = &#63;.
410            *
411            * @param a3 the a3 to search with
412            * @return the number of matching countries
413            * @throws SystemException if a system exception occurred
414            */
415            public int countByA3(java.lang.String a3)
416                    throws com.liferay.portal.kernel.exception.SystemException;
417    
418            /**
419            * Counts all the countries where active = &#63;.
420            *
421            * @param active the active to search with
422            * @return the number of matching countries
423            * @throws SystemException if a system exception occurred
424            */
425            public int countByActive(boolean active)
426                    throws com.liferay.portal.kernel.exception.SystemException;
427    
428            /**
429            * Counts all the countries.
430            *
431            * @return the number of countries
432            * @throws SystemException if a system exception occurred
433            */
434            public int countAll()
435                    throws com.liferay.portal.kernel.exception.SystemException;
436    }