|
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.RegionUtil
@ProviderType public class RegionUtil
The persistence utility for the region service. This utility wraps RegionPersistenceImpl
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
RegionPersistence
,
RegionPersistenceImpl
Constructor Summary | |
---|---|
RegionUtil()
|
Method Summary | |
---|---|
static void |
cacheResult(List<Region> regions)
Caches the regions in the entity cache if it is enabled. |
static void |
cacheResult(Region region)
Caches the region in the entity cache if it is enabled. |
static void |
clearCache()
|
static void |
clearCache(Region region)
|
static int |
countAll()
Returns the number of regions. |
static int |
countByActive(boolean active)
Returns the number of regions where active = ?. |
static int |
countByC_A(long countryId,
boolean active)
Returns the number of regions where countryId = ? and active = ?. |
static int |
countByC_R(long countryId,
String regionCode)
Returns the number of regions where countryId = ? and regionCode = ?. |
static int |
countByCountryId(long countryId)
Returns the number of regions where countryId = ?. |
static long |
countWithDynamicQuery(DynamicQuery dynamicQuery)
|
static Region |
create(long regionId)
Creates a new region with the primary key. |
static Region |
fetchByActive_First(boolean active,
OrderByComparator orderByComparator)
Returns the first region in the ordered set where active = ?. |
static Region |
fetchByActive_Last(boolean active,
OrderByComparator orderByComparator)
Returns the last region in the ordered set where active = ?. |
static Region |
fetchByC_A_First(long countryId,
boolean active,
OrderByComparator orderByComparator)
Returns the first region in the ordered set where countryId = ? and active = ?. |
static Region |
fetchByC_A_Last(long countryId,
boolean active,
OrderByComparator orderByComparator)
Returns the last region in the ordered set where countryId = ? and active = ?. |
static Region |
fetchByC_R(long countryId,
String regionCode)
Returns the region where countryId = ? and regionCode = ? or returns null if it could not be found. |
static Region |
fetchByC_R(long countryId,
String regionCode,
boolean retrieveFromCache)
Returns the region where countryId = ? and regionCode = ? or returns null if it could not be found, optionally using the finder cache. |
static Region |
fetchByCountryId_First(long countryId,
OrderByComparator orderByComparator)
Returns the first region in the ordered set where countryId = ?. |
static Region |
fetchByCountryId_Last(long countryId,
OrderByComparator orderByComparator)
Returns the last region in the ordered set where countryId = ?. |
static Region |
fetchByPrimaryKey(long regionId)
Returns the region with the primary key or returns null if it could not be found. |
static List<Region> |
findAll()
Returns all the regions. |
static List<Region> |
findAll(int start,
int end)
Returns a range of all the regions. |
static List<Region> |
findAll(int start,
int end,
OrderByComparator orderByComparator)
Returns an ordered range of all the regions. |
static Region |
findByActive_First(boolean active,
OrderByComparator orderByComparator)
Returns the first region in the ordered set where active = ?. |
static Region |
findByActive_Last(boolean active,
OrderByComparator orderByComparator)
Returns the last region in the ordered set where active = ?. |
static Region[] |
findByActive_PrevAndNext(long regionId,
boolean active,
OrderByComparator orderByComparator)
Returns the regions before and after the current region in the ordered set where active = ?. |
static List<Region> |
findByActive(boolean active)
Returns all the regions where active = ?. |
static List<Region> |
findByActive(boolean active,
int start,
int end)
Returns a range of all the regions where active = ?. |
static List<Region> |
findByActive(boolean active,
int start,
int end,
OrderByComparator orderByComparator)
Returns an ordered range of all the regions where active = ?. |
static Region |
findByC_A_First(long countryId,
boolean active,
OrderByComparator orderByComparator)
Returns the first region in the ordered set where countryId = ? and active = ?. |
static Region |
findByC_A_Last(long countryId,
boolean active,
OrderByComparator orderByComparator)
Returns the last region in the ordered set where countryId = ? and active = ?. |
static Region[] |
findByC_A_PrevAndNext(long regionId,
long countryId,
boolean active,
OrderByComparator orderByComparator)
Returns the regions before and after the current region in the ordered set where countryId = ? and active = ?. |
static List<Region> |
findByC_A(long countryId,
boolean active)
Returns all the regions where countryId = ? and active = ?. |
static List<Region> |
findByC_A(long countryId,
boolean active,
int start,
int end)
Returns a range of all the regions where countryId = ? and active = ?. |
static List<Region> |
findByC_A(long countryId,
boolean active,
int start,
int end,
OrderByComparator orderByComparator)
Returns an ordered range of all the regions where countryId = ? and active = ?. |
static Region |
findByC_R(long countryId,
String regionCode)
Returns the region where countryId = ? and regionCode = ? or throws a NoSuchRegionException if it could not be found. |
static Region |
findByCountryId_First(long countryId,
OrderByComparator orderByComparator)
Returns the first region in the ordered set where countryId = ?. |
static Region |
findByCountryId_Last(long countryId,
OrderByComparator orderByComparator)
Returns the last region in the ordered set where countryId = ?. |
static Region[] |
findByCountryId_PrevAndNext(long regionId,
long countryId,
OrderByComparator orderByComparator)
Returns the regions before and after the current region in the ordered set where countryId = ?. |
static List<Region> |
findByCountryId(long countryId)
Returns all the regions where countryId = ?. |
static List<Region> |
findByCountryId(long countryId,
int start,
int end)
Returns a range of all the regions where countryId = ?. |
static List<Region> |
findByCountryId(long countryId,
int start,
int end,
OrderByComparator orderByComparator)
Returns an ordered range of all the regions where countryId = ?. |
static Region |
findByPrimaryKey(long regionId)
Returns the region with the primary key or throws a NoSuchRegionException if it could not be found. |
static List<Region> |
findWithDynamicQuery(DynamicQuery dynamicQuery)
|
static List<Region> |
findWithDynamicQuery(DynamicQuery dynamicQuery,
int start,
int end)
|
static List<Region> |
findWithDynamicQuery(DynamicQuery dynamicQuery,
int start,
int end,
OrderByComparator orderByComparator)
|
static RegionPersistence |
getPersistence()
|
static Region |
remove(long regionId)
Removes the region with the primary key from the database. |
static void |
removeAll()
Removes all the regions from the database. |
static void |
removeByActive(boolean active)
Removes all the regions where active = ? from the database. |
static void |
removeByC_A(long countryId,
boolean active)
Removes all the regions where countryId = ? and active = ? from the database. |
static Region |
removeByC_R(long countryId,
String regionCode)
Removes the region where countryId = ? and regionCode = ? from the database. |
static void |
removeByCountryId(long countryId)
Removes all the regions where countryId = ? from the database. |
void |
setPersistence(RegionPersistence persistence)
Deprecated. As of 6.2.0 |
static Region |
update(Region region)
|
static Region |
update(Region region,
ServiceContext serviceContext)
|
static Region |
updateImpl(Region region)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RegionUtil()
Method Detail |
---|
public static void clearCache()
BasePersistence.clearCache()
public static void clearCache(Region region)
BasePersistence.clearCache(com.liferay.portal.model.BaseModel)
public static long countWithDynamicQuery(DynamicQuery dynamicQuery) throws SystemException
SystemException
BasePersistence.countWithDynamicQuery(DynamicQuery)
public static List<Region> findWithDynamicQuery(DynamicQuery dynamicQuery) throws SystemException
SystemException
BasePersistence.findWithDynamicQuery(DynamicQuery)
public static List<Region> findWithDynamicQuery(DynamicQuery dynamicQuery, int start, int end) throws SystemException
SystemException
BasePersistence.findWithDynamicQuery(DynamicQuery, int, int)
public static List<Region> findWithDynamicQuery(DynamicQuery dynamicQuery, int start, int end, OrderByComparator orderByComparator) throws SystemException
SystemException
BasePersistence.findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator)
public static Region update(Region region) throws SystemException
SystemException
BasePersistence.update(com.liferay.portal.model.BaseModel)
public static Region update(Region region, ServiceContext serviceContext) throws SystemException
SystemException
BasePersistence.update(com.liferay.portal.model.BaseModel, ServiceContext)
public static List<Region> findByCountryId(long countryId) throws SystemException
countryId
- the country ID
SystemException
- if a system exception occurredpublic static List<Region> findByCountryId(long countryId, 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 RegionModelImpl
. 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.
countryId
- the country IDstart
- the lower bound of the range of regionsend
- the upper bound of the range of regions (not inclusive)
SystemException
- if a system exception occurredpublic static List<Region> findByCountryId(long countryId, 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 RegionModelImpl
. 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.
countryId
- the country IDstart
- the lower bound of the range of regionsend
- the upper bound of the range of regions (not inclusive)orderByComparator
- the comparator to order the results by (optionally null
)
SystemException
- if a system exception occurredpublic static Region findByCountryId_First(long countryId, OrderByComparator orderByComparator) throws NoSuchRegionException, SystemException
countryId
- the country IDorderByComparator
- the comparator to order the set by (optionally null
)
NoSuchRegionException
- if a matching region could not be found
SystemException
- if a system exception occurredpublic static Region fetchByCountryId_First(long countryId, OrderByComparator orderByComparator) throws SystemException
countryId
- the country IDorderByComparator
- the comparator to order the set by (optionally null
)
null
if a matching region could not be found
SystemException
- if a system exception occurredpublic static Region findByCountryId_Last(long countryId, OrderByComparator orderByComparator) throws NoSuchRegionException, SystemException
countryId
- the country IDorderByComparator
- the comparator to order the set by (optionally null
)
NoSuchRegionException
- if a matching region could not be found
SystemException
- if a system exception occurredpublic static Region fetchByCountryId_Last(long countryId, OrderByComparator orderByComparator) throws SystemException
countryId
- the country IDorderByComparator
- the comparator to order the set by (optionally null
)
null
if a matching region could not be found
SystemException
- if a system exception occurredpublic static Region[] findByCountryId_PrevAndNext(long regionId, long countryId, OrderByComparator orderByComparator) throws NoSuchRegionException, SystemException
regionId
- the primary key of the current regioncountryId
- the country IDorderByComparator
- the comparator to order the set by (optionally null
)
NoSuchRegionException
- if a region with the primary key could not be found
SystemException
- if a system exception occurredpublic static void removeByCountryId(long countryId) throws SystemException
countryId
- the country ID
SystemException
- if a system exception occurredpublic static int countByCountryId(long countryId) throws SystemException
countryId
- the country ID
SystemException
- if a system exception occurredpublic static List<Region> findByActive(boolean active) throws SystemException
active
- the active
SystemException
- if a system exception occurredpublic static List<Region> 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 RegionModelImpl
. 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 regionsend
- the upper bound of the range of regions (not inclusive)
SystemException
- if a system exception occurredpublic static List<Region> 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 RegionModelImpl
. 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 regionsend
- the upper bound of the range of regions (not inclusive)orderByComparator
- the comparator to order the results by (optionally null
)
SystemException
- if a system exception occurredpublic static Region findByActive_First(boolean active, OrderByComparator orderByComparator) throws NoSuchRegionException, SystemException
active
- the activeorderByComparator
- the comparator to order the set by (optionally null
)
NoSuchRegionException
- if a matching region could not be found
SystemException
- if a system exception occurredpublic static Region fetchByActive_First(boolean active, OrderByComparator orderByComparator) throws SystemException
active
- the activeorderByComparator
- the comparator to order the set by (optionally null
)
null
if a matching region could not be found
SystemException
- if a system exception occurredpublic static Region findByActive_Last(boolean active, OrderByComparator orderByComparator) throws NoSuchRegionException, SystemException
active
- the activeorderByComparator
- the comparator to order the set by (optionally null
)
NoSuchRegionException
- if a matching region could not be found
SystemException
- if a system exception occurredpublic static Region fetchByActive_Last(boolean active, OrderByComparator orderByComparator) throws SystemException
active
- the activeorderByComparator
- the comparator to order the set by (optionally null
)
null
if a matching region could not be found
SystemException
- if a system exception occurredpublic static Region[] findByActive_PrevAndNext(long regionId, boolean active, OrderByComparator orderByComparator) throws NoSuchRegionException, SystemException
regionId
- the primary key of the current regionactive
- the activeorderByComparator
- the comparator to order the set by (optionally null
)
NoSuchRegionException
- if a region 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 Region findByC_R(long countryId, String regionCode) throws NoSuchRegionException, SystemException
NoSuchRegionException
if it could not be found.
countryId
- the country IDregionCode
- the region code
NoSuchRegionException
- if a matching region could not be found
SystemException
- if a system exception occurredpublic static Region fetchByC_R(long countryId, String regionCode) throws SystemException
null
if it could not be found. Uses the finder cache.
countryId
- the country IDregionCode
- the region code
null
if a matching region could not be found
SystemException
- if a system exception occurredpublic static Region fetchByC_R(long countryId, String regionCode, boolean retrieveFromCache) throws SystemException
null
if it could not be found, optionally using the finder cache.
countryId
- the country IDregionCode
- the region coderetrieveFromCache
- whether to use the finder cache
null
if a matching region could not be found
SystemException
- if a system exception occurredpublic static Region removeByC_R(long countryId, String regionCode) throws NoSuchRegionException, SystemException
countryId
- the country IDregionCode
- the region code
SystemException
- if a system exception occurred
NoSuchRegionException
public static int countByC_R(long countryId, String regionCode) throws SystemException
countryId
- the country IDregionCode
- the region code
SystemException
- if a system exception occurredpublic static List<Region> findByC_A(long countryId, boolean active) throws SystemException
countryId
- the country IDactive
- the active
SystemException
- if a system exception occurredpublic static List<Region> findByC_A(long countryId, 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 RegionModelImpl
. 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.
countryId
- the country IDactive
- the activestart
- the lower bound of the range of regionsend
- the upper bound of the range of regions (not inclusive)
SystemException
- if a system exception occurredpublic static List<Region> findByC_A(long countryId, 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 RegionModelImpl
. 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.
countryId
- the country IDactive
- the activestart
- the lower bound of the range of regionsend
- the upper bound of the range of regions (not inclusive)orderByComparator
- the comparator to order the results by (optionally null
)
SystemException
- if a system exception occurredpublic static Region findByC_A_First(long countryId, boolean active, OrderByComparator orderByComparator) throws NoSuchRegionException, SystemException
countryId
- the country IDactive
- the activeorderByComparator
- the comparator to order the set by (optionally null
)
NoSuchRegionException
- if a matching region could not be found
SystemException
- if a system exception occurredpublic static Region fetchByC_A_First(long countryId, boolean active, OrderByComparator orderByComparator) throws SystemException
countryId
- the country IDactive
- the activeorderByComparator
- the comparator to order the set by (optionally null
)
null
if a matching region could not be found
SystemException
- if a system exception occurredpublic static Region findByC_A_Last(long countryId, boolean active, OrderByComparator orderByComparator) throws NoSuchRegionException, SystemException
countryId
- the country IDactive
- the activeorderByComparator
- the comparator to order the set by (optionally null
)
NoSuchRegionException
- if a matching region could not be found
SystemException
- if a system exception occurredpublic static Region fetchByC_A_Last(long countryId, boolean active, OrderByComparator orderByComparator) throws SystemException
countryId
- the country IDactive
- the activeorderByComparator
- the comparator to order the set by (optionally null
)
null
if a matching region could not be found
SystemException
- if a system exception occurredpublic static Region[] findByC_A_PrevAndNext(long regionId, long countryId, boolean active, OrderByComparator orderByComparator) throws NoSuchRegionException, SystemException
regionId
- the primary key of the current regioncountryId
- the country IDactive
- the activeorderByComparator
- the comparator to order the set by (optionally null
)
NoSuchRegionException
- if a region with the primary key could not be found
SystemException
- if a system exception occurredpublic static void removeByC_A(long countryId, boolean active) throws SystemException
countryId
- the country IDactive
- the active
SystemException
- if a system exception occurredpublic static int countByC_A(long countryId, boolean active) throws SystemException
countryId
- the country IDactive
- the active
SystemException
- if a system exception occurredpublic static void cacheResult(Region region)
region
- the regionpublic static void cacheResult(List<Region> regions)
regions
- the regionspublic static Region create(long regionId)
regionId
- the primary key for the new region
public static Region remove(long regionId) throws NoSuchRegionException, SystemException
regionId
- the primary key of the region
NoSuchRegionException
- if a region with the primary key could not be found
SystemException
- if a system exception occurredpublic static Region updateImpl(Region region) throws SystemException
SystemException
public static Region findByPrimaryKey(long regionId) throws NoSuchRegionException, SystemException
NoSuchRegionException
if it could not be found.
regionId
- the primary key of the region
NoSuchRegionException
- if a region with the primary key could not be found
SystemException
- if a system exception occurredpublic static Region fetchByPrimaryKey(long regionId) throws SystemException
null
if it could not be found.
regionId
- the primary key of the region
null
if a region with the primary key could not be found
SystemException
- if a system exception occurredpublic static List<Region> findAll() throws SystemException
SystemException
- if a system exception occurredpublic static List<Region> 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 RegionModelImpl
. 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 regionsend
- the upper bound of the range of regions (not inclusive)
SystemException
- if a system exception occurredpublic static List<Region> 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 RegionModelImpl
. 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 regionsend
- the upper bound of the range of regions (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 RegionPersistence getPersistence()
public void setPersistence(RegionPersistence persistence)
|
Liferay 6.2-ce-ga5 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |