Liferay 6.0.5

com.liferay.portal.service.persistence
Interface CountryPersistence

All Superinterfaces:
BasePersistence<Country>
All Known Implementing Classes:
CountryPersistenceImpl

public interface CountryPersistence
extends BasePersistence<Country>

The persistence interface for the country service.

Never modify or reference this interface directly. Always use CountryUtil to access the country persistence. Modify service.xml and rerun ServiceBuilder to regenerate this interface.

Caching information and settings can be found in portal.properties

See Also:
CountryPersistenceImpl, CountryUtil
ServiceBuilder generated this class. Modifications in this class will be overwritten the next time is generated.

Method Summary
 void cacheResult(Country country)
          Caches the country in the entity cache if it is enabled.
 void cacheResult(List<Country> countries)
          Caches the countries in the entity cache if it is enabled.
 int countAll()
          Counts all the countries.
 int countByA2(String a2)
          Counts all the countries where a2 = ?.
 int countByA3(String a3)
          Counts all the countries where a3 = ?.
 int countByActive(boolean active)
          Counts all the countries where active = ?.
 int countByName(String name)
          Counts all the countries where name = ?.
 Country create(long countryId)
          Creates a new country with the primary key.
 Country fetchByA2(String a2)
          Finds the country where a2 = ? or returns null if it could not be found.
 Country fetchByA2(String a2, boolean retrieveFromCache)
          Finds the country where a2 = ? or returns null if it could not be found, optionally using the finder cache.
 Country fetchByA3(String a3)
          Finds the country where a3 = ? or returns null if it could not be found.
 Country fetchByA3(String a3, boolean retrieveFromCache)
          Finds the country where a3 = ? or returns null if it could not be found, optionally using the finder cache.
 Country fetchByName(String name)
          Finds the country where name = ? or returns null if it could not be found.
 Country fetchByName(String name, boolean retrieveFromCache)
          Finds the country where name = ? or returns null if it could not be found, optionally using the finder cache.
 Country fetchByPrimaryKey(long countryId)
          Finds the country with the primary key or returns null if it could not be found.
 List<Country> findAll()
          Finds all the countries.
 List<Country> findAll(int start, int end)
          Finds a range of all the countries.
 List<Country> findAll(int start, int end, OrderByComparator orderByComparator)
          Finds an ordered range of all the countries.
 Country findByA2(String a2)
          Finds the country where a2 = ? or throws a NoSuchCountryException if it could not be found.
 Country findByA3(String a3)
          Finds the country where a3 = ? or throws a NoSuchCountryException if it could not be found.
 Country findByActive_First(boolean active, OrderByComparator orderByComparator)
          Finds the first country in the ordered set where active = ?.
 Country findByActive_Last(boolean active, OrderByComparator orderByComparator)
          Finds the last country in the ordered set where active = ?.
 Country[] findByActive_PrevAndNext(long countryId, boolean active, OrderByComparator orderByComparator)
          Finds the countries before and after the current country in the ordered set where active = ?.
 List<Country> findByActive(boolean active)
          Finds all the countries where active = ?.
 List<Country> findByActive(boolean active, int start, int end)
          Finds a range of all the countries where active = ?.
 List<Country> findByActive(boolean active, int start, int end, OrderByComparator orderByComparator)
          Finds an ordered range of all the countries where active = ?.
 Country findByName(String name)
          Finds the country where name = ? or throws a NoSuchCountryException if it could not be found.
 Country findByPrimaryKey(long countryId)
          Finds the country with the primary key or throws a NoSuchCountryException if it could not be found.
 Country remove(long countryId)
          Removes the country with the primary key from the database.
 void removeAll()
          Removes all the countries from the database.
 void removeByA2(String a2)
          Removes the country where a2 = ? from the database.
 void removeByA3(String a3)
          Removes the country where a3 = ? from the database.
 void removeByActive(boolean active)
          Removes all the countries where active = ? from the database.
 void removeByName(String name)
          Removes the country where name = ? from the database.
 Country updateImpl(Country country, boolean merge)
           
 
Methods inherited from interface com.liferay.portal.service.persistence.BasePersistence
clearCache, clearCache, countWithDynamicQuery, fetchByPrimaryKey, findByPrimaryKey, findWithDynamicQuery, findWithDynamicQuery, findWithDynamicQuery, getDataSource, getListeners, registerListener, remove, remove, setDataSource, unregisterListener, update, update
 

Method Detail

cacheResult

void cacheResult(Country country)
Caches the country in the entity cache if it is enabled.

Parameters:
country - the country to cache

cacheResult

void cacheResult(List<Country> countries)
Caches the countries in the entity cache if it is enabled.

Parameters:
countries - the countries to cache

create

Country create(long countryId)
Creates a new country with the primary key. Does not add the country to the database.

Parameters:
countryId - the primary key for the new country
Returns:
the new country

remove

Country remove(long countryId)
               throws NoSuchCountryException,
                      SystemException
Removes the country with the primary key from the database. Also notifies the appropriate model listeners.

Parameters:
countryId - the primary key of the country to remove
Returns:
the country that was removed
Throws:
NoSuchCountryException - if a country with the primary key could not be found
SystemException - if a system exception occurred

updateImpl

Country updateImpl(Country country,
                   boolean merge)
                   throws SystemException
Throws:
SystemException

findByPrimaryKey

Country findByPrimaryKey(long countryId)
                         throws NoSuchCountryException,
                                SystemException
Finds the country with the primary key or throws a NoSuchCountryException if it could not be found.

Parameters:
countryId - the primary key of the country to find
Returns:
the country
Throws:
NoSuchCountryException - if a country with the primary key could not be found
SystemException - if a system exception occurred

fetchByPrimaryKey

Country fetchByPrimaryKey(long countryId)
                          throws SystemException
Finds the country with the primary key or returns null if it could not be found.

Parameters:
countryId - the primary key of the country to find
Returns:
the country, or null if a country with the primary key could not be found
Throws:
SystemException - if a system exception occurred

findByName

Country findByName(String name)
                   throws NoSuchCountryException,
                          SystemException
Finds the country where name = ? or throws a NoSuchCountryException if it could not be found.

Parameters:
name - the name to search with
Returns:
the matching country
Throws:
NoSuchCountryException - if a matching country could not be found
SystemException - if a system exception occurred

fetchByName

Country fetchByName(String name)
                    throws SystemException
Finds the country where name = ? or returns null if it could not be found. Uses the finder cache.

Parameters:
name - the name to search with
Returns:
the matching country, or null if a matching country could not be found
Throws:
SystemException - if a system exception occurred

fetchByName

Country fetchByName(String name,
                    boolean retrieveFromCache)
                    throws SystemException
Finds the country where name = ? or returns null if it could not be found, optionally using the finder cache.

Parameters:
name - the name to search with
Returns:
the matching country, or null if a matching country could not be found
Throws:
SystemException - if a system exception occurred

findByA2

Country findByA2(String a2)
                 throws NoSuchCountryException,
                        SystemException
Finds the country where a2 = ? or throws a NoSuchCountryException if it could not be found.

Parameters:
a2 - the a2 to search with
Returns:
the matching country
Throws:
NoSuchCountryException - if a matching country could not be found
SystemException - if a system exception occurred

fetchByA2

Country fetchByA2(String a2)
                  throws SystemException
Finds the country where a2 = ? or returns null if it could not be found. Uses the finder cache.

Parameters:
a2 - the a2 to search with
Returns:
the matching country, or null if a matching country could not be found
Throws:
SystemException - if a system exception occurred

fetchByA2

Country fetchByA2(String a2,
                  boolean retrieveFromCache)
                  throws SystemException
Finds the country where a2 = ? or returns null if it could not be found, optionally using the finder cache.

Parameters:
a2 - the a2 to search with
Returns:
the matching country, or null if a matching country could not be found
Throws:
SystemException - if a system exception occurred

findByA3

Country findByA3(String a3)
                 throws NoSuchCountryException,
                        SystemException
Finds the country where a3 = ? or throws a NoSuchCountryException if it could not be found.

Parameters:
a3 - the a3 to search with
Returns:
the matching country
Throws:
NoSuchCountryException - if a matching country could not be found
SystemException - if a system exception occurred

fetchByA3

Country fetchByA3(String a3)
                  throws SystemException
Finds the country where a3 = ? or returns null if it could not be found. Uses the finder cache.

Parameters:
a3 - the a3 to search with
Returns:
the matching country, or null if a matching country could not be found
Throws:
SystemException - if a system exception occurred

fetchByA3

Country fetchByA3(String a3,
                  boolean retrieveFromCache)
                  throws SystemException
Finds the country where a3 = ? or returns null if it could not be found, optionally using the finder cache.

Parameters:
a3 - the a3 to search with
Returns:
the matching country, or null if a matching country could not be found
Throws:
SystemException - if a system exception occurred

findByActive

List<Country> findByActive(boolean active)
                           throws SystemException
Finds all the countries where active = ?.

Parameters:
active - the active to search with
Returns:
the matching countries
Throws:
SystemException - if a system exception occurred

findByActive

List<Country> findByActive(boolean active,
                           int start,
                           int end)
                           throws SystemException
Finds a range of all the countries where active = ?.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set.

Parameters:
active - the active to search with
start - the lower bound of the range of countries to return
end - the upper bound of the range of countries to return (not inclusive)
Returns:
the range of matching countries
Throws:
SystemException - if a system exception occurred

findByActive

List<Country> findByActive(boolean active,
                           int start,
                           int end,
                           OrderByComparator orderByComparator)
                           throws SystemException
Finds an ordered range of all the countries where active = ?.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set.

Parameters:
active - the active to search with
start - the lower bound of the range of countries to return
end - the upper bound of the range of countries to return (not inclusive)
orderByComparator - the comparator to order the results by
Returns:
the ordered range of matching countries
Throws:
SystemException - if a system exception occurred

findByActive_First

Country findByActive_First(boolean active,
                           OrderByComparator orderByComparator)
                           throws NoSuchCountryException,
                                  SystemException
Finds the first country in the ordered set where active = ?.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set.

Parameters:
active - the active to search with
orderByComparator - the comparator to order the set by
Returns:
the first matching country
Throws:
NoSuchCountryException - if a matching country could not be found
SystemException - if a system exception occurred

findByActive_Last

Country findByActive_Last(boolean active,
                          OrderByComparator orderByComparator)
                          throws NoSuchCountryException,
                                 SystemException
Finds the last country in the ordered set where active = ?.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set.

Parameters:
active - the active to search with
orderByComparator - the comparator to order the set by
Returns:
the last matching country
Throws:
NoSuchCountryException - if a matching country could not be found
SystemException - if a system exception occurred

findByActive_PrevAndNext

Country[] findByActive_PrevAndNext(long countryId,
                                   boolean active,
                                   OrderByComparator orderByComparator)
                                   throws NoSuchCountryException,
                                          SystemException
Finds the countries before and after the current country in the ordered set where active = ?.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set.

Parameters:
countryId - the primary key of the current country
active - the active to search with
orderByComparator - the comparator to order the set by
Returns:
the previous, current, and next country
Throws:
NoSuchCountryException - if a country with the primary key could not be found
SystemException - if a system exception occurred

findAll

List<Country> findAll()
                      throws SystemException
Finds all the countries.

Returns:
the countries
Throws:
SystemException - if a system exception occurred

findAll

List<Country> findAll(int start,
                      int end)
                      throws SystemException
Finds a range of all the countries.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set.

Parameters:
start - the lower bound of the range of countries to return
end - the upper bound of the range of countries to return (not inclusive)
Returns:
the range of countries
Throws:
SystemException - if a system exception occurred

findAll

List<Country> findAll(int start,
                      int end,
                      OrderByComparator orderByComparator)
                      throws SystemException
Finds an ordered range of all the countries.

Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to QueryUtil.ALL_POS will return the full result set.

Parameters:
start - the lower bound of the range of countries to return
end - the upper bound of the range of countries to return (not inclusive)
orderByComparator - the comparator to order the results by
Returns:
the ordered range of countries
Throws:
SystemException - if a system exception occurred

removeByName

void removeByName(String name)
                  throws NoSuchCountryException,
                         SystemException
Removes the country where name = ? from the database.

Parameters:
name - the name to search with
Throws:
SystemException - if a system exception occurred
NoSuchCountryException

removeByA2

void removeByA2(String a2)
                throws NoSuchCountryException,
                       SystemException
Removes the country where a2 = ? from the database.

Parameters:
a2 - the a2 to search with
Throws:
SystemException - if a system exception occurred
NoSuchCountryException

removeByA3

void removeByA3(String a3)
                throws NoSuchCountryException,
                       SystemException
Removes the country where a3 = ? from the database.

Parameters:
a3 - the a3 to search with
Throws:
SystemException - if a system exception occurred
NoSuchCountryException

removeByActive

void removeByActive(boolean active)
                    throws SystemException
Removes all the countries where active = ? from the database.

Parameters:
active - the active to search with
Throws:
SystemException - if a system exception occurred

removeAll

void removeAll()
               throws SystemException
Removes all the countries from the database.

Throws:
SystemException - if a system exception occurred

countByName

int countByName(String name)
                throws SystemException
Counts all the countries where name = ?.

Parameters:
name - the name to search with
Returns:
the number of matching countries
Throws:
SystemException - if a system exception occurred

countByA2

int countByA2(String a2)
              throws SystemException
Counts all the countries where a2 = ?.

Parameters:
a2 - the a2 to search with
Returns:
the number of matching countries
Throws:
SystemException - if a system exception occurred

countByA3

int countByA3(String a3)
              throws SystemException
Counts all the countries where a3 = ?.

Parameters:
a3 - the a3 to search with
Returns:
the number of matching countries
Throws:
SystemException - if a system exception occurred

countByActive

int countByActive(boolean active)
                  throws SystemException
Counts all the countries where active = ?.

Parameters:
active - the active to search with
Returns:
the number of matching countries
Throws:
SystemException - if a system exception occurred

countAll

int countAll()
             throws SystemException
Counts all the countries.

Returns:
the number of countries
Throws:
SystemException - if a system exception occurred

Liferay 6.0.5