001    /**
002     * Copyright (c) 2000-2011 Liferay, Inc. All rights reserved.
003     *
004     * The contents of this file are subject to the terms of the Liferay Enterprise
005     * Subscription License ("License"). You may not use this file except in
006     * compliance with the License. You can obtain a copy of the License by
007     * contacting Liferay, Inc. See the License for the specific language governing
008     * permissions and limitations under the License, including but not limited to
009     * distribution rights of the Software.
010     *
011     *
012     *
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 to cache
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 to cache
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 to remove
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            * Finds 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 to find
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            * Finds 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 to find
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            * Finds 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 to search with
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            * Finds 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 to search with
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            * Finds 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 to search with
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            * Finds 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 to search with
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            * Finds 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 to search with
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            * Finds 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 to search with
159            * @return the matching country, or <code>null</code> if a matching country could not be found
160            * @throws SystemException if a system exception occurred
161            */
162            public com.liferay.portal.model.Country fetchByA2(java.lang.String a2,
163                    boolean retrieveFromCache)
164                    throws com.liferay.portal.kernel.exception.SystemException;
165    
166            /**
167            * Finds the country where a3 = &#63; or throws a {@link com.liferay.portal.NoSuchCountryException} if it could not be found.
168            *
169            * @param a3 the a3 to search with
170            * @return the matching country
171            * @throws com.liferay.portal.NoSuchCountryException if a matching country could not be found
172            * @throws SystemException if a system exception occurred
173            */
174            public com.liferay.portal.model.Country findByA3(java.lang.String a3)
175                    throws com.liferay.portal.NoSuchCountryException,
176                            com.liferay.portal.kernel.exception.SystemException;
177    
178            /**
179            * Finds the country where a3 = &#63; or returns <code>null</code> if it could not be found. Uses the finder cache.
180            *
181            * @param a3 the a3 to search with
182            * @return the matching country, or <code>null</code> if a matching country could not be found
183            * @throws SystemException if a system exception occurred
184            */
185            public com.liferay.portal.model.Country fetchByA3(java.lang.String a3)
186                    throws com.liferay.portal.kernel.exception.SystemException;
187    
188            /**
189            * Finds the country where a3 = &#63; or returns <code>null</code> if it could not be found, optionally using the finder cache.
190            *
191            * @param a3 the a3 to search with
192            * @return the matching country, or <code>null</code> if a matching country could not be found
193            * @throws SystemException if a system exception occurred
194            */
195            public com.liferay.portal.model.Country fetchByA3(java.lang.String a3,
196                    boolean retrieveFromCache)
197                    throws com.liferay.portal.kernel.exception.SystemException;
198    
199            /**
200            * Finds all the countries where active = &#63;.
201            *
202            * @param active the active to search with
203            * @return the matching countries
204            * @throws SystemException if a system exception occurred
205            */
206            public java.util.List<com.liferay.portal.model.Country> findByActive(
207                    boolean active)
208                    throws com.liferay.portal.kernel.exception.SystemException;
209    
210            /**
211            * Finds a range of all the countries where active = &#63;.
212            *
213            * <p>
214            * 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.
215            * </p>
216            *
217            * @param active the active to search with
218            * @param start the lower bound of the range of countries to return
219            * @param end the upper bound of the range of countries to return (not inclusive)
220            * @return the range of matching countries
221            * @throws SystemException if a system exception occurred
222            */
223            public java.util.List<com.liferay.portal.model.Country> findByActive(
224                    boolean active, int start, int end)
225                    throws com.liferay.portal.kernel.exception.SystemException;
226    
227            /**
228            * Finds an ordered range of all the countries where active = &#63;.
229            *
230            * <p>
231            * 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.
232            * </p>
233            *
234            * @param active the active to search with
235            * @param start the lower bound of the range of countries to return
236            * @param end the upper bound of the range of countries to return (not inclusive)
237            * @param orderByComparator the comparator to order the results by
238            * @return the ordered range of matching countries
239            * @throws SystemException if a system exception occurred
240            */
241            public java.util.List<com.liferay.portal.model.Country> findByActive(
242                    boolean active, int start, int end,
243                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
244                    throws com.liferay.portal.kernel.exception.SystemException;
245    
246            /**
247            * Finds the first country in the ordered set where active = &#63;.
248            *
249            * <p>
250            * 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.
251            * </p>
252            *
253            * @param active the active to search with
254            * @param orderByComparator the comparator to order the set by
255            * @return the first matching country
256            * @throws com.liferay.portal.NoSuchCountryException if a matching country could not be found
257            * @throws SystemException if a system exception occurred
258            */
259            public com.liferay.portal.model.Country findByActive_First(boolean active,
260                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
261                    throws com.liferay.portal.NoSuchCountryException,
262                            com.liferay.portal.kernel.exception.SystemException;
263    
264            /**
265            * Finds the last country in the ordered set where active = &#63;.
266            *
267            * <p>
268            * 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.
269            * </p>
270            *
271            * @param active the active to search with
272            * @param orderByComparator the comparator to order the set by
273            * @return the last matching country
274            * @throws com.liferay.portal.NoSuchCountryException if a matching country could not be found
275            * @throws SystemException if a system exception occurred
276            */
277            public com.liferay.portal.model.Country findByActive_Last(boolean active,
278                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
279                    throws com.liferay.portal.NoSuchCountryException,
280                            com.liferay.portal.kernel.exception.SystemException;
281    
282            /**
283            * Finds the countries before and after the current country in the ordered set where active = &#63;.
284            *
285            * <p>
286            * 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.
287            * </p>
288            *
289            * @param countryId the primary key of the current country
290            * @param active the active to search with
291            * @param orderByComparator the comparator to order the set by
292            * @return the previous, current, and next country
293            * @throws com.liferay.portal.NoSuchCountryException if a country with the primary key could not be found
294            * @throws SystemException if a system exception occurred
295            */
296            public com.liferay.portal.model.Country[] findByActive_PrevAndNext(
297                    long countryId, boolean active,
298                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
299                    throws com.liferay.portal.NoSuchCountryException,
300                            com.liferay.portal.kernel.exception.SystemException;
301    
302            /**
303            * Finds all the countries.
304            *
305            * @return the countries
306            * @throws SystemException if a system exception occurred
307            */
308            public java.util.List<com.liferay.portal.model.Country> findAll()
309                    throws com.liferay.portal.kernel.exception.SystemException;
310    
311            /**
312            * Finds a range of all the countries.
313            *
314            * <p>
315            * 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.
316            * </p>
317            *
318            * @param start the lower bound of the range of countries to return
319            * @param end the upper bound of the range of countries to return (not inclusive)
320            * @return the range of countries
321            * @throws SystemException if a system exception occurred
322            */
323            public java.util.List<com.liferay.portal.model.Country> findAll(int start,
324                    int end) throws com.liferay.portal.kernel.exception.SystemException;
325    
326            /**
327            * Finds an ordered 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 to return
334            * @param end the upper bound of the range of countries to return (not inclusive)
335            * @param orderByComparator the comparator to order the results by
336            * @return the ordered range of countries
337            * @throws SystemException if a system exception occurred
338            */
339            public java.util.List<com.liferay.portal.model.Country> findAll(int start,
340                    int end,
341                    com.liferay.portal.kernel.util.OrderByComparator orderByComparator)
342                    throws com.liferay.portal.kernel.exception.SystemException;
343    
344            /**
345            * Removes the country where name = &#63; from the database.
346            *
347            * @param name the name to search with
348            * @throws SystemException if a system exception occurred
349            */
350            public void removeByName(java.lang.String name)
351                    throws com.liferay.portal.NoSuchCountryException,
352                            com.liferay.portal.kernel.exception.SystemException;
353    
354            /**
355            * Removes the country where a2 = &#63; from the database.
356            *
357            * @param a2 the a2 to search with
358            * @throws SystemException if a system exception occurred
359            */
360            public void removeByA2(java.lang.String a2)
361                    throws com.liferay.portal.NoSuchCountryException,
362                            com.liferay.portal.kernel.exception.SystemException;
363    
364            /**
365            * Removes the country where a3 = &#63; from the database.
366            *
367            * @param a3 the a3 to search with
368            * @throws SystemException if a system exception occurred
369            */
370            public void removeByA3(java.lang.String a3)
371                    throws com.liferay.portal.NoSuchCountryException,
372                            com.liferay.portal.kernel.exception.SystemException;
373    
374            /**
375            * Removes all the countries where active = &#63; from the database.
376            *
377            * @param active the active to search with
378            * @throws SystemException if a system exception occurred
379            */
380            public void removeByActive(boolean active)
381                    throws com.liferay.portal.kernel.exception.SystemException;
382    
383            /**
384            * Removes all the countries from the database.
385            *
386            * @throws SystemException if a system exception occurred
387            */
388            public void removeAll()
389                    throws com.liferay.portal.kernel.exception.SystemException;
390    
391            /**
392            * Counts all the countries where name = &#63;.
393            *
394            * @param name the name to search with
395            * @return the number of matching countries
396            * @throws SystemException if a system exception occurred
397            */
398            public int countByName(java.lang.String name)
399                    throws com.liferay.portal.kernel.exception.SystemException;
400    
401            /**
402            * Counts all the countries where a2 = &#63;.
403            *
404            * @param a2 the a2 to search with
405            * @return the number of matching countries
406            * @throws SystemException if a system exception occurred
407            */
408            public int countByA2(java.lang.String a2)
409                    throws com.liferay.portal.kernel.exception.SystemException;
410    
411            /**
412            * Counts all the countries where a3 = &#63;.
413            *
414            * @param a3 the a3 to search with
415            * @return the number of matching countries
416            * @throws SystemException if a system exception occurred
417            */
418            public int countByA3(java.lang.String a3)
419                    throws com.liferay.portal.kernel.exception.SystemException;
420    
421            /**
422            * Counts all the countries where active = &#63;.
423            *
424            * @param active the active to search with
425            * @return the number of matching countries
426            * @throws SystemException if a system exception occurred
427            */
428            public int countByActive(boolean active)
429                    throws com.liferay.portal.kernel.exception.SystemException;
430    
431            /**
432            * Counts all the countries.
433            *
434            * @return the number of countries
435            * @throws SystemException if a system exception occurred
436            */
437            public int countAll()
438                    throws com.liferay.portal.kernel.exception.SystemException;
439    
440            public Country remove(Country country) throws SystemException;
441    }