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