Liferay 7.0-ce-b4

com.liferay.portal.service.persistence
Interface CountryPersistence

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

@ProviderType
public interface CountryPersistence
extends BasePersistence<Country>

The persistence interface for the country service.

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 it 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()
          Returns the number of countries.
 int countByA2(String a2)
          Returns the number of countries where a2 = ?.
 int countByA3(String a3)
          Returns the number of countries where a3 = ?.
 int countByActive(boolean active)
          Returns the number of countries where active = ?.
 int countByName(String name)
          Returns the number of countries where name = ?.
 Country create(long countryId)
          Creates a new country with the primary key.
 Country fetchByA2(String a2)
          Returns the country where a2 = ? or returns null if it could not be found.
 Country fetchByA2(String a2, boolean retrieveFromCache)
          Returns the country where a2 = ? or returns null if it could not be found, optionally using the finder cache.
 Country fetchByA3(String a3)
          Returns the country where a3 = ? or returns null if it could not be found.
 Country fetchByA3(String a3, boolean retrieveFromCache)
          Returns the country where a3 = ? or returns null if it could not be found, optionally using the finder cache.
 Country fetchByActive_First(boolean active, OrderByComparator<Country> orderByComparator)
          Returns the first country in the ordered set where active = ?.
 Country fetchByActive_Last(boolean active, OrderByComparator<Country> orderByComparator)
          Returns the last country in the ordered set where active = ?.
 Country fetchByName(String name)
          Returns the country where name = ? or returns null if it could not be found.
 Country fetchByName(String name, boolean retrieveFromCache)
          Returns the country where name = ? or returns null if it could not be found, optionally using the finder cache.
 Country fetchByPrimaryKey(long countryId)
          Returns the country with the primary key or returns null if it could not be found.
 Map<Serializable,Country> fetchByPrimaryKeys(Set<Serializable> primaryKeys)
           
 List<Country> findAll()
          Returns all the countries.
 List<Country> findAll(int start, int end)
          Returns a range of all the countries.
 List<Country> findAll(int start, int end, OrderByComparator<Country> orderByComparator)
          Returns an ordered range of all the countries.
 List<Country> findAll(int start, int end, OrderByComparator<Country> orderByComparator, boolean retrieveFromCache)
          Returns an ordered range of all the countries.
 Country findByA2(String a2)
          Returns the country where a2 = ? or throws a NoSuchCountryException if it could not be found.
 Country findByA3(String a3)
          Returns the country where a3 = ? or throws a NoSuchCountryException if it could not be found.
 Country findByActive_First(boolean active, OrderByComparator<Country> orderByComparator)
          Returns the first country in the ordered set where active = ?.
 Country findByActive_Last(boolean active, OrderByComparator<Country> orderByComparator)
          Returns the last country in the ordered set where active = ?.
 Country[] findByActive_PrevAndNext(long countryId, boolean active, OrderByComparator<Country> orderByComparator)
          Returns the countries before and after the current country in the ordered set where active = ?.
 List<Country> findByActive(boolean active)
          Returns all the countries where active = ?.
 List<Country> findByActive(boolean active, int start, int end)
          Returns a range of all the countries where active = ?.
 List<Country> findByActive(boolean active, int start, int end, OrderByComparator<Country> orderByComparator)
          Returns an ordered range of all the countries where active = ?.
 List<Country> findByActive(boolean active, int start, int end, OrderByComparator<Country> orderByComparator, boolean retrieveFromCache)
          Returns an ordered range of all the countries where active = ?.
 Country findByName(String name)
          Returns the country where name = ? or throws a NoSuchCountryException if it could not be found.
 Country findByPrimaryKey(long countryId)
          Returns the country with the primary key or throws a NoSuchCountryException if it could not be found.
 Set<String> getBadColumnNames()
           
 Country remove(long countryId)
          Removes the country with the primary key from the database.
 void removeAll()
          Removes all the countries from the database.
 Country removeByA2(String a2)
          Removes the country where a2 = ? from the database.
 Country removeByA3(String a3)
          Removes the country where a3 = ? from the database.
 void removeByActive(boolean active)
          Removes all the countries where active = ? from the database.
 Country removeByName(String name)
          Removes the country where name = ? from the database.
 Country updateImpl(Country country)
           
 
Methods inherited from interface com.liferay.portal.service.persistence.BasePersistence
clearCache, clearCache, clearCache, closeSession, countWithDynamicQuery, countWithDynamicQuery, fetchByPrimaryKey, findByPrimaryKey, findWithDynamicQuery, findWithDynamicQuery, findWithDynamicQuery, flush, getCurrentSession, getDataSource, getListeners, getModelClass, openSession, processException, registerListener, remove, remove, setDataSource, unregisterListener, update, update, update, update
 

Method Detail

findByName

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

Parameters:
name - the name
Returns:
the matching country
Throws:
NoSuchCountryException - if a matching country could not be found

fetchByName

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

Parameters:
name - the name
Returns:
the matching country, or null if a matching country could not be found

fetchByName

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

Parameters:
name - the name
retrieveFromCache - whether to retrieve from the finder cache
Returns:
the matching country, or null if a matching country could not be found

removeByName

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

Parameters:
name - the name
Returns:
the country that was removed
Throws:
NoSuchCountryException

countByName

int countByName(String name)
Returns the number of countries where name = ?.

Parameters:
name - the name
Returns:
the number of matching countries

findByA2

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

Parameters:
a2 - the a2
Returns:
the matching country
Throws:
NoSuchCountryException - if a matching country could not be found

fetchByA2

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

Parameters:
a2 - the a2
Returns:
the matching country, or null if a matching country could not be found

fetchByA2

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

Parameters:
a2 - the a2
retrieveFromCache - whether to retrieve from the finder cache
Returns:
the matching country, or null if a matching country could not be found

removeByA2

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

Parameters:
a2 - the a2
Returns:
the country that was removed
Throws:
NoSuchCountryException

countByA2

int countByA2(String a2)
Returns the number of countries where a2 = ?.

Parameters:
a2 - the a2
Returns:
the number of matching countries

findByA3

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

Parameters:
a3 - the a3
Returns:
the matching country
Throws:
NoSuchCountryException - if a matching country could not be found

fetchByA3

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

Parameters:
a3 - the a3
Returns:
the matching country, or null if a matching country could not be found

fetchByA3

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

Parameters:
a3 - the a3
retrieveFromCache - whether to retrieve from the finder cache
Returns:
the matching country, or null if a matching country could not be found

removeByA3

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

Parameters:
a3 - the a3
Returns:
the country that was removed
Throws:
NoSuchCountryException

countByA3

int countByA3(String a3)
Returns the number of countries where a3 = ?.

Parameters:
a3 - the a3
Returns:
the number of matching countries

findByActive

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

Parameters:
active - the active
Returns:
the matching countries

findByActive

List<Country> findByActive(boolean active,
                           int start,
                           int end)
Returns 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. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent and pagination is required (start and end are not QueryUtil#ALL_POS), then the query will include the default ORDER BY logic from CountryModelImpl. If both orderByComparator 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.

Parameters:
active - the active
start - the lower bound of the range of countries
end - the upper bound of the range of countries (not inclusive)
Returns:
the range of matching countries

findByActive

List<Country> findByActive(boolean active,
                           int start,
                           int end,
                           OrderByComparator<Country> orderByComparator)
Returns 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. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent and pagination is required (start and end are not QueryUtil#ALL_POS), then the query will include the default ORDER BY logic from CountryModelImpl. If both orderByComparator 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.

Parameters:
active - the active
start - the lower bound of the range of countries
end - the upper bound of the range of countries (not inclusive)
orderByComparator - the comparator to order the results by (optionally null)
Returns:
the ordered range of matching countries

findByActive

List<Country> findByActive(boolean active,
                           int start,
                           int end,
                           OrderByComparator<Country> orderByComparator,
                           boolean retrieveFromCache)
Returns 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. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent and pagination is required (start and end are not QueryUtil#ALL_POS), then the query will include the default ORDER BY logic from CountryModelImpl. If both orderByComparator 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.

Parameters:
active - the active
start - the lower bound of the range of countries
end - the upper bound of the range of countries (not inclusive)
orderByComparator - the comparator to order the results by (optionally null)
retrieveFromCache - whether to retrieve from the finder cache
Returns:
the ordered range of matching countries

findByActive_First

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

Parameters:
active - the active
orderByComparator - the comparator to order the set by (optionally null)
Returns:
the first matching country
Throws:
NoSuchCountryException - if a matching country could not be found

fetchByActive_First

Country fetchByActive_First(boolean active,
                            OrderByComparator<Country> orderByComparator)
Returns the first country in the ordered set where active = ?.

Parameters:
active - the active
orderByComparator - the comparator to order the set by (optionally null)
Returns:
the first matching country, or null if a matching country could not be found

findByActive_Last

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

Parameters:
active - the active
orderByComparator - the comparator to order the set by (optionally null)
Returns:
the last matching country
Throws:
NoSuchCountryException - if a matching country could not be found

fetchByActive_Last

Country fetchByActive_Last(boolean active,
                           OrderByComparator<Country> orderByComparator)
Returns the last country in the ordered set where active = ?.

Parameters:
active - the active
orderByComparator - the comparator to order the set by (optionally null)
Returns:
the last matching country, or null if a matching country could not be found

findByActive_PrevAndNext

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

Parameters:
countryId - the primary key of the current country
active - the active
orderByComparator - the comparator to order the set by (optionally null)
Returns:
the previous, current, and next country
Throws:
NoSuchCountryException - if a country with the primary key could not be found

removeByActive

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

Parameters:
active - the active

countByActive

int countByActive(boolean active)
Returns the number of countries where active = ?.

Parameters:
active - the active
Returns:
the number of matching countries

cacheResult

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

Parameters:
country - the country

cacheResult

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

Parameters:
countries - the countries

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
Removes the country with the primary key from the database. Also notifies the appropriate model listeners.

Parameters:
countryId - the primary key of the country
Returns:
the country that was removed
Throws:
NoSuchCountryException - if a country with the primary key could not be found

updateImpl

Country updateImpl(Country country)

findByPrimaryKey

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

Parameters:
countryId - the primary key of the country
Returns:
the country
Throws:
NoSuchCountryException - if a country with the primary key could not be found

fetchByPrimaryKey

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

Parameters:
countryId - the primary key of the country
Returns:
the country, or null if a country with the primary key could not be found

fetchByPrimaryKeys

Map<Serializable,Country> fetchByPrimaryKeys(Set<Serializable> primaryKeys)
Specified by:
fetchByPrimaryKeys in interface BasePersistence<Country>

findAll

List<Country> findAll()
Returns all the countries.

Returns:
the countries

findAll

List<Country> findAll(int start,
                      int end)
Returns 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. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent and pagination is required (start and end are not QueryUtil#ALL_POS), then the query will include the default ORDER BY logic from CountryModelImpl. If both orderByComparator 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.

Parameters:
start - the lower bound of the range of countries
end - the upper bound of the range of countries (not inclusive)
Returns:
the range of countries

findAll

List<Country> findAll(int start,
                      int end,
                      OrderByComparator<Country> orderByComparator)
Returns 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. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent and pagination is required (start and end are not QueryUtil#ALL_POS), then the query will include the default ORDER BY logic from CountryModelImpl. If both orderByComparator 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.

Parameters:
start - the lower bound of the range of countries
end - the upper bound of the range of countries (not inclusive)
orderByComparator - the comparator to order the results by (optionally null)
Returns:
the ordered range of countries

findAll

List<Country> findAll(int start,
                      int end,
                      OrderByComparator<Country> orderByComparator,
                      boolean retrieveFromCache)
Returns 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. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent and pagination is required (start and end are not QueryUtil#ALL_POS), then the query will include the default ORDER BY logic from CountryModelImpl. If both orderByComparator 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.

Parameters:
start - the lower bound of the range of countries
end - the upper bound of the range of countries (not inclusive)
orderByComparator - the comparator to order the results by (optionally null)
retrieveFromCache - whether to retrieve from the finder cache
Returns:
the ordered range of countries

removeAll

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


countAll

int countAll()
Returns the number of countries.

Returns:
the number of countries

getBadColumnNames

Set<String> getBadColumnNames()
Specified by:
getBadColumnNames in interface BasePersistence<Country>

Liferay 7.0-ce-b4