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