|
Liferay 6.2-ce-ga5 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.liferay.portal.service.persistence.CountryUtil
@ProviderType public class CountryUtil
The persistence utility for the country service. This utility wraps CountryPersistenceImpl
and provides direct access to the database for CRUD operations. This utility should only be used by the service layer, as it must operate within a transaction. Never access this utility in a JSP, controller, model, or other front-end class.
Caching information and settings can be found in portal.properties
CountryPersistence
,
CountryPersistenceImpl
Constructor Summary | |
---|---|
CountryUtil()
|
Method Summary | |
---|---|
static void |
cacheResult(Country country)
Caches the country in the entity cache if it is enabled. |
static void |
cacheResult(List<Country> countries)
Caches the countries in the entity cache if it is enabled. |
static void |
clearCache()
|
static void |
clearCache(Country country)
|
static int |
countAll()
Returns the number of countries. |
static int |
countByA2(String a2)
Returns the number of countries where a2 = ?. |
static int |
countByA3(String a3)
Returns the number of countries where a3 = ?. |
static int |
countByActive(boolean active)
Returns the number of countries where active = ?. |
static int |
countByName(String name)
Returns the number of countries where name = ?. |
static long |
countWithDynamicQuery(DynamicQuery dynamicQuery)
|
static Country |
create(long countryId)
Creates a new country with the primary key. |
static Country |
fetchByA2(String a2)
Returns the country where a2 = ? or returns null if it could not be found. |
static 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. |
static Country |
fetchByA3(String a3)
Returns the country where a3 = ? or returns null if it could not be found. |
static 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. |
static Country |
fetchByActive_First(boolean active,
OrderByComparator orderByComparator)
Returns the first country in the ordered set where active = ?. |
static Country |
fetchByActive_Last(boolean active,
OrderByComparator orderByComparator)
Returns the last country in the ordered set where active = ?. |
static Country |
fetchByName(String name)
Returns the country where name = ? or returns null if it could not be found. |
static 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. |
static Country |
fetchByPrimaryKey(long countryId)
Returns the country with the primary key or returns null if it could not be found. |
static List<Country> |
findAll()
Returns all the countries. |
static List<Country> |
findAll(int start,
int end)
Returns a range of all the countries. |
static List<Country> |
findAll(int start,
int end,
OrderByComparator orderByComparator)
Returns an ordered range of all the countries. |
static Country |
findByA2(String a2)
Returns the country where a2 = ? or throws a NoSuchCountryException if it could not be found. |
static Country |
findByA3(String a3)
Returns the country where a3 = ? or throws a NoSuchCountryException if it could not be found. |
static Country |
findByActive_First(boolean active,
OrderByComparator orderByComparator)
Returns the first country in the ordered set where active = ?. |
static Country |
findByActive_Last(boolean active,
OrderByComparator orderByComparator)
Returns the last country in the ordered set where active = ?. |
static Country[] |
findByActive_PrevAndNext(long countryId,
boolean active,
OrderByComparator orderByComparator)
Returns the countries before and after the current country in the ordered set where active = ?. |
static List<Country> |
findByActive(boolean active)
Returns all the countries where active = ?. |
static List<Country> |
findByActive(boolean active,
int start,
int end)
Returns a range of all the countries where active = ?. |
static List<Country> |
findByActive(boolean active,
int start,
int end,
OrderByComparator orderByComparator)
Returns an ordered range of all the countries where active = ?. |
static Country |
findByName(String name)
Returns the country where name = ? or throws a NoSuchCountryException if it could not be found. |
static Country |
findByPrimaryKey(long countryId)
Returns the country with the primary key or throws a NoSuchCountryException if it could not be found. |
static List<Country> |
findWithDynamicQuery(DynamicQuery dynamicQuery)
|
static List<Country> |
findWithDynamicQuery(DynamicQuery dynamicQuery,
int start,
int end)
|
static List<Country> |
findWithDynamicQuery(DynamicQuery dynamicQuery,
int start,
int end,
OrderByComparator orderByComparator)
|
static CountryPersistence |
getPersistence()
|
static Country |
remove(long countryId)
Removes the country with the primary key from the database. |
static void |
removeAll()
Removes all the countries from the database. |
static Country |
removeByA2(String a2)
Removes the country where a2 = ? from the database. |
static Country |
removeByA3(String a3)
Removes the country where a3 = ? from the database. |
static void |
removeByActive(boolean active)
Removes all the countries where active = ? from the database. |
static Country |
removeByName(String name)
Removes the country where name = ? from the database. |
void |
setPersistence(CountryPersistence persistence)
Deprecated. As of 6.2.0 |
static Country |
update(Country country)
|
static Country |
update(Country country,
ServiceContext serviceContext)
|
static Country |
updateImpl(Country country)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public CountryUtil()
Method Detail |
---|
public static void clearCache()
BasePersistence.clearCache()
public static void clearCache(Country country)
BasePersistence.clearCache(com.liferay.portal.model.BaseModel)
public static long countWithDynamicQuery(DynamicQuery dynamicQuery) throws SystemException
SystemException
BasePersistence.countWithDynamicQuery(DynamicQuery)
public static List<Country> findWithDynamicQuery(DynamicQuery dynamicQuery) throws SystemException
SystemException
BasePersistence.findWithDynamicQuery(DynamicQuery)
public static List<Country> findWithDynamicQuery(DynamicQuery dynamicQuery, int start, int end) throws SystemException
SystemException
BasePersistence.findWithDynamicQuery(DynamicQuery, int, int)
public static List<Country> findWithDynamicQuery(DynamicQuery dynamicQuery, int start, int end, OrderByComparator orderByComparator) throws SystemException
SystemException
BasePersistence.findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator)
public static Country update(Country country) throws SystemException
SystemException
BasePersistence.update(com.liferay.portal.model.BaseModel)
public static Country update(Country country, ServiceContext serviceContext) throws SystemException
SystemException
BasePersistence.update(com.liferay.portal.model.BaseModel, ServiceContext)
public static Country findByName(String name) throws NoSuchCountryException, SystemException
NoSuchCountryException
if it could not be found.
name
- the name
NoSuchCountryException
- if a matching country could not be found
SystemException
- if a system exception occurredpublic static Country fetchByName(String name) throws SystemException
null
if it could not be found. Uses the finder cache.
name
- the name
null
if a matching country could not be found
SystemException
- if a system exception occurredpublic static Country fetchByName(String name, boolean retrieveFromCache) throws SystemException
null
if it could not be found, optionally using the finder cache.
name
- the nameretrieveFromCache
- whether to use the finder cache
null
if a matching country could not be found
SystemException
- if a system exception occurredpublic static Country removeByName(String name) throws NoSuchCountryException, SystemException
name
- the name
SystemException
- if a system exception occurred
NoSuchCountryException
public static int countByName(String name) throws SystemException
name
- the name
SystemException
- if a system exception occurredpublic static Country findByA2(String a2) throws NoSuchCountryException, SystemException
NoSuchCountryException
if it could not be found.
a2
- the a2
NoSuchCountryException
- if a matching country could not be found
SystemException
- if a system exception occurredpublic static Country fetchByA2(String a2) throws SystemException
null
if it could not be found. Uses the finder cache.
a2
- the a2
null
if a matching country could not be found
SystemException
- if a system exception occurredpublic static Country fetchByA2(String a2, boolean retrieveFromCache) throws SystemException
null
if it could not be found, optionally using the finder cache.
a2
- the a2retrieveFromCache
- whether to use the finder cache
null
if a matching country could not be found
SystemException
- if a system exception occurredpublic static Country removeByA2(String a2) throws NoSuchCountryException, SystemException
a2
- the a2
SystemException
- if a system exception occurred
NoSuchCountryException
public static int countByA2(String a2) throws SystemException
a2
- the a2
SystemException
- if a system exception occurredpublic static Country findByA3(String a3) throws NoSuchCountryException, SystemException
NoSuchCountryException
if it could not be found.
a3
- the a3
NoSuchCountryException
- if a matching country could not be found
SystemException
- if a system exception occurredpublic static Country fetchByA3(String a3) throws SystemException
null
if it could not be found. Uses the finder cache.
a3
- the a3
null
if a matching country could not be found
SystemException
- if a system exception occurredpublic static Country fetchByA3(String a3, boolean retrieveFromCache) throws SystemException
null
if it could not be found, optionally using the finder cache.
a3
- the a3retrieveFromCache
- whether to use the finder cache
null
if a matching country could not be found
SystemException
- if a system exception occurredpublic static Country removeByA3(String a3) throws NoSuchCountryException, SystemException
a3
- the a3
SystemException
- if a system exception occurred
NoSuchCountryException
public static int countByA3(String a3) throws SystemException
a3
- the a3
SystemException
- if a system exception occurredpublic static List<Country> findByActive(boolean active) throws SystemException
active
- the active
SystemException
- if a system exception occurredpublic static List<Country> findByActive(boolean active, int start, int end) throws SystemException
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.
active
- the activestart
- the lower bound of the range of countriesend
- the upper bound of the range of countries (not inclusive)
SystemException
- if a system exception occurredpublic static List<Country> findByActive(boolean active, int start, int end, OrderByComparator orderByComparator) throws SystemException
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.
active
- the activestart
- the lower bound of the range of countriesend
- the upper bound of the range of countries (not inclusive)orderByComparator
- the comparator to order the results by (optionally null
)
SystemException
- if a system exception occurredpublic static Country findByActive_First(boolean active, OrderByComparator orderByComparator) throws NoSuchCountryException, SystemException
active
- the activeorderByComparator
- the comparator to order the set by (optionally null
)
NoSuchCountryException
- if a matching country could not be found
SystemException
- if a system exception occurredpublic static Country fetchByActive_First(boolean active, OrderByComparator orderByComparator) throws SystemException
active
- the activeorderByComparator
- the comparator to order the set by (optionally null
)
null
if a matching country could not be found
SystemException
- if a system exception occurredpublic static Country findByActive_Last(boolean active, OrderByComparator orderByComparator) throws NoSuchCountryException, SystemException
active
- the activeorderByComparator
- the comparator to order the set by (optionally null
)
NoSuchCountryException
- if a matching country could not be found
SystemException
- if a system exception occurredpublic static Country fetchByActive_Last(boolean active, OrderByComparator orderByComparator) throws SystemException
active
- the activeorderByComparator
- the comparator to order the set by (optionally null
)
null
if a matching country could not be found
SystemException
- if a system exception occurredpublic static Country[] findByActive_PrevAndNext(long countryId, boolean active, OrderByComparator orderByComparator) throws NoSuchCountryException, SystemException
countryId
- the primary key of the current countryactive
- the activeorderByComparator
- the comparator to order the set by (optionally null
)
NoSuchCountryException
- if a country with the primary key could not be found
SystemException
- if a system exception occurredpublic static void removeByActive(boolean active) throws SystemException
active
- the active
SystemException
- if a system exception occurredpublic static int countByActive(boolean active) throws SystemException
active
- the active
SystemException
- if a system exception occurredpublic static void cacheResult(Country country)
country
- the countrypublic static void cacheResult(List<Country> countries)
countries
- the countriespublic static Country create(long countryId)
countryId
- the primary key for the new country
public static Country remove(long countryId) throws NoSuchCountryException, SystemException
countryId
- the primary key of the country
NoSuchCountryException
- if a country with the primary key could not be found
SystemException
- if a system exception occurredpublic static Country updateImpl(Country country) throws SystemException
SystemException
public static Country findByPrimaryKey(long countryId) throws NoSuchCountryException, SystemException
NoSuchCountryException
if it could not be found.
countryId
- the primary key of the country
NoSuchCountryException
- if a country with the primary key could not be found
SystemException
- if a system exception occurredpublic static Country fetchByPrimaryKey(long countryId) throws SystemException
null
if it could not be found.
countryId
- the primary key of the country
null
if a country with the primary key could not be found
SystemException
- if a system exception occurredpublic static List<Country> findAll() throws SystemException
SystemException
- if a system exception occurredpublic static List<Country> findAll(int start, int end) throws SystemException
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.
start
- the lower bound of the range of countriesend
- the upper bound of the range of countries (not inclusive)
SystemException
- if a system exception occurredpublic static List<Country> findAll(int start, int end, OrderByComparator orderByComparator) throws SystemException
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.
start
- the lower bound of the range of countriesend
- the upper bound of the range of countries (not inclusive)orderByComparator
- the comparator to order the results by (optionally null
)
SystemException
- if a system exception occurredpublic static void removeAll() throws SystemException
SystemException
- if a system exception occurredpublic static int countAll() throws SystemException
SystemException
- if a system exception occurredpublic static CountryPersistence getPersistence()
public void setPersistence(CountryPersistence persistence)
|
Liferay 6.2-ce-ga5 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |