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