public class RegionLocalServiceUtil
extends Object
com.liferay.portal.service.impl.RegionLocalServiceImpl
and
is an access point for service operations in application layer code running
on the local server. Methods of this service will not have security checks
based on the propagated JAAS credentials because this service can only be
accessed from within the same VM.RegionLocalService
Constructor and Description |
---|
RegionLocalServiceUtil() |
Modifier and Type | Method and Description |
---|---|
static Region |
addRegion(long countryId,
boolean active,
String name,
double position,
String regionCode,
ServiceContext serviceContext) |
static Region |
addRegion(Region region)
Adds the region to the database.
|
static PersistedModel |
createPersistedModel(Serializable primaryKeyObj) |
static Region |
createRegion(long regionId)
Creates a new region with the primary key.
|
static void |
deleteCountryRegions(long countryId) |
static PersistedModel |
deletePersistedModel(PersistedModel persistedModel) |
static Region |
deleteRegion(long regionId)
Deletes the region with the primary key from the database.
|
static Region |
deleteRegion(Region region)
Deletes the region from the database.
|
static <T> T |
dslQuery(com.liferay.petra.sql.dsl.query.DSLQuery dslQuery) |
static int |
dslQueryCount(com.liferay.petra.sql.dsl.query.DSLQuery dslQuery) |
static DynamicQuery |
dynamicQuery() |
static <T> List<T> |
dynamicQuery(DynamicQuery dynamicQuery)
Performs a dynamic query on the database and returns the matching rows.
|
static <T> List<T> |
dynamicQuery(DynamicQuery dynamicQuery,
int start,
int end)
Performs a dynamic query on the database and returns a range of the matching rows.
|
static <T> List<T> |
dynamicQuery(DynamicQuery dynamicQuery,
int start,
int end,
OrderByComparator<T> orderByComparator)
Performs a dynamic query on the database and returns an ordered range of the matching rows.
|
static long |
dynamicQueryCount(DynamicQuery dynamicQuery)
Returns the number of rows matching the dynamic query.
|
static long |
dynamicQueryCount(DynamicQuery dynamicQuery,
Projection projection)
Returns the number of rows matching the dynamic query.
|
static Region |
fetchRegion(long regionId) |
static Region |
fetchRegion(long countryId,
String regionCode) |
static Region |
fetchRegionByUuidAndCompanyId(String uuid,
long companyId)
Returns the region with the matching UUID and company.
|
static RegionLocalization |
fetchRegionLocalization(long regionId,
String languageId) |
static ActionableDynamicQuery |
getActionableDynamicQuery() |
static ExportActionableDynamicQuery |
getExportActionableDynamicQuery(PortletDataContext portletDataContext) |
static IndexableActionableDynamicQuery |
getIndexableActionableDynamicQuery() |
static String |
getOSGiServiceIdentifier()
Returns the OSGi service identifier.
|
static PersistedModel |
getPersistedModel(Serializable primaryKeyObj) |
static Region |
getRegion(long regionId)
Returns the region with the primary key.
|
static Region |
getRegion(long countryId,
String regionCode) |
static Region |
getRegionByUuidAndCompanyId(String uuid,
long companyId)
Returns the region with the matching UUID and company.
|
static RegionLocalization |
getRegionLocalization(long regionId,
String languageId) |
static List<RegionLocalization> |
getRegionLocalizations(long regionId) |
static List<Region> |
getRegions(int start,
int end)
Returns a range of all the regions.
|
static List<Region> |
getRegions(long countryId,
boolean active) |
static List<Region> |
getRegions(long countryId,
boolean active,
int start,
int end,
OrderByComparator<Region> orderByComparator) |
static List<Region> |
getRegions(long countryId,
int start,
int end,
OrderByComparator<Region> orderByComparator) |
static List<Region> |
getRegions(long companyId,
String a2,
boolean active) |
static int |
getRegionsCount()
Returns the number of regions.
|
static int |
getRegionsCount(long countryId) |
static int |
getRegionsCount(long countryId,
boolean active) |
static RegionLocalService |
getService() |
static BaseModelSearchResult<Region> |
searchRegions(long companyId,
Boolean active,
String keywords,
LinkedHashMap<String,Object> params,
int start,
int end,
OrderByComparator<Region> orderByComparator) |
static void |
setService(RegionLocalService service) |
static Region |
updateActive(long regionId,
boolean active) |
static Region |
updateRegion(long regionId,
boolean active,
String name,
double position,
String regionCode) |
static Region |
updateRegion(Region region)
Updates the region in the database or adds it if it does not yet exist.
|
static RegionLocalization |
updateRegionLocalization(Region region,
String languageId,
String title) |
static List<RegionLocalization> |
updateRegionLocalizations(Region region,
Map<String,String> titleMap) |
public static Region addRegion(long countryId, boolean active, String name, double position, String regionCode, ServiceContext serviceContext) throws PortalException
PortalException
public static Region addRegion(Region region)
Important: Inspect RegionLocalServiceImpl for overloaded versions of the method. If provided, use these entry points to the API, as the implementation logic may require the additional parameters defined there.
region
- the regionpublic static PersistedModel createPersistedModel(Serializable primaryKeyObj) throws PortalException
PortalException
public static Region createRegion(long regionId)
regionId
- the primary key for the new regionpublic static void deleteCountryRegions(long countryId)
public static PersistedModel deletePersistedModel(PersistedModel persistedModel) throws PortalException
PortalException
public static Region deleteRegion(long regionId) throws PortalException
Important: Inspect RegionLocalServiceImpl for overloaded versions of the method. If provided, use these entry points to the API, as the implementation logic may require the additional parameters defined there.
regionId
- the primary key of the regionPortalException
- if a region with the primary key could not be foundpublic static Region deleteRegion(Region region)
Important: Inspect RegionLocalServiceImpl for overloaded versions of the method. If provided, use these entry points to the API, as the implementation logic may require the additional parameters defined there.
region
- the regionpublic static <T> T dslQuery(com.liferay.petra.sql.dsl.query.DSLQuery dslQuery)
public static int dslQueryCount(com.liferay.petra.sql.dsl.query.DSLQuery dslQuery)
public static DynamicQuery dynamicQuery()
public static <T> List<T> dynamicQuery(DynamicQuery dynamicQuery)
dynamicQuery
- the dynamic querypublic static <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start, int end)
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 com.liferay.portal.kernel.dao.orm.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, then the query will include the default ORDER BY logic from com.liferay.portal.model.impl.RegionModelImpl
.
dynamicQuery
- the dynamic querystart
- the lower bound of the range of model instancesend
- the upper bound of the range of model instances (not inclusive)public static <T> List<T> dynamicQuery(DynamicQuery dynamicQuery, int start, int end, OrderByComparator<T> orderByComparator)
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 com.liferay.portal.kernel.dao.orm.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, then the query will include the default ORDER BY logic from com.liferay.portal.model.impl.RegionModelImpl
.
dynamicQuery
- the dynamic querystart
- the lower bound of the range of model instancesend
- the upper bound of the range of model instances (not inclusive)orderByComparator
- the comparator to order the results by (optionally null
)public static long dynamicQueryCount(DynamicQuery dynamicQuery)
dynamicQuery
- the dynamic querypublic static long dynamicQueryCount(DynamicQuery dynamicQuery, Projection projection)
dynamicQuery
- the dynamic queryprojection
- the projection to apply to the querypublic static Region fetchRegion(long regionId)
public static Region fetchRegion(long countryId, String regionCode)
public static Region fetchRegionByUuidAndCompanyId(String uuid, long companyId)
uuid
- the region's UUIDcompanyId
- the primary key of the companynull
if a matching region could not be foundpublic static RegionLocalization fetchRegionLocalization(long regionId, String languageId)
public static ActionableDynamicQuery getActionableDynamicQuery()
public static ExportActionableDynamicQuery getExportActionableDynamicQuery(PortletDataContext portletDataContext)
public static IndexableActionableDynamicQuery getIndexableActionableDynamicQuery()
public static String getOSGiServiceIdentifier()
public static PersistedModel getPersistedModel(Serializable primaryKeyObj) throws PortalException
PortalException
public static Region getRegion(long regionId) throws PortalException
regionId
- the primary key of the regionPortalException
- if a region with the primary key could not be foundpublic static Region getRegion(long countryId, String regionCode) throws PortalException
PortalException
public static Region getRegionByUuidAndCompanyId(String uuid, long companyId) throws PortalException
uuid
- the region's UUIDcompanyId
- the primary key of the companyPortalException
- if a matching region could not be foundpublic static RegionLocalization getRegionLocalization(long regionId, String languageId) throws PortalException
PortalException
public static List<RegionLocalization> getRegionLocalizations(long regionId)
public static List<Region> getRegions(int start, int end)
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 com.liferay.portal.kernel.dao.orm.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, then the query will include the default ORDER BY logic from com.liferay.portal.model.impl.RegionModelImpl
.
start
- the lower bound of the range of regionsend
- the upper bound of the range of regions (not inclusive)public static List<Region> getRegions(long countryId, boolean active) throws PortalException
PortalException
public static List<Region> getRegions(long countryId, boolean active, int start, int end, OrderByComparator<Region> orderByComparator)
public static List<Region> getRegions(long countryId, int start, int end, OrderByComparator<Region> orderByComparator)
public static List<Region> getRegions(long companyId, String a2, boolean active) throws PortalException
PortalException
public static int getRegionsCount()
public static int getRegionsCount(long countryId)
public static int getRegionsCount(long countryId, boolean active)
public static BaseModelSearchResult<Region> searchRegions(long companyId, Boolean active, String keywords, LinkedHashMap<String,Object> params, int start, int end, OrderByComparator<Region> orderByComparator) throws PortalException
PortalException
public static Region updateActive(long regionId, boolean active) throws PortalException
PortalException
public static Region updateRegion(long regionId, boolean active, String name, double position, String regionCode) throws PortalException
PortalException
public static Region updateRegion(Region region)
Important: Inspect RegionLocalServiceImpl for overloaded versions of the method. If provided, use these entry points to the API, as the implementation logic may require the additional parameters defined there.
region
- the regionpublic static RegionLocalization updateRegionLocalization(Region region, String languageId, String title) throws PortalException
PortalException
public static List<RegionLocalization> updateRegionLocalizations(Region region, Map<String,String> titleMap) throws PortalException
PortalException
public static RegionLocalService getService()
public static void setService(RegionLocalService service)