Class RegionLocalServiceUtil
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.- Author:
- Brian Wing Shun Chan
- See Also:
- {$generated.description}
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Region
addRegion
(long countryId, boolean active, String name, double position, String regionCode, ServiceContext serviceContext) static 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
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
static ExportActionableDynamicQuery
getExportActionableDynamicQuery
(PortletDataContext portletDataContext) static String
Returns the OSGi service identifier.static PersistedModel
getPersistedModel
(Serializable primaryKeyObj) static Region
getRegion
(long regionId) Returns the region with the primary key.static Region
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) getRegions
(int start, int end) Returns a range of all the regions.getRegions
(long countryId, boolean active) getRegions
(long countryId, boolean active, int start, int end, OrderByComparator<Region> orderByComparator) getRegions
(long countryId, int start, int end, OrderByComparator<Region> orderByComparator) getRegions
(long companyId, String a2, boolean active) static int
Returns the number of regions.static int
getRegionsCount
(long countryId) static int
getRegionsCount
(long countryId, boolean active) static RegionLocalService
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)
-
Constructor Details
-
RegionLocalServiceUtil
public RegionLocalServiceUtil()
-
-
Method Details
-
addRegion
public static Region addRegion(long countryId, boolean active, String name, double position, String regionCode, ServiceContext serviceContext) throws PortalException - Throws:
PortalException
-
addRegion
Adds the region to the database. Also notifies the appropriate model listeners.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.
- Parameters:
region
- the region- Returns:
- the region that was added
-
createPersistedModel
public static PersistedModel createPersistedModel(Serializable primaryKeyObj) throws PortalException - Throws:
PortalException
-
createRegion
Creates a new region with the primary key. Does not add the region to the database.- Parameters:
regionId
- the primary key for the new region- Returns:
- the new region
-
deleteCountryRegions
public static void deleteCountryRegions(long countryId) -
deletePersistedModel
public static PersistedModel deletePersistedModel(PersistedModel persistedModel) throws PortalException - Throws:
PortalException
-
deleteRegion
Deletes the region with the primary key from the database. Also notifies the appropriate model listeners.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.
- Parameters:
regionId
- the primary key of the region- Returns:
- the region that was removed
- Throws:
PortalException
- if a region with the primary key could not be found
-
deleteRegion
Deletes the region from the database. Also notifies the appropriate model listeners.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.
- Parameters:
region
- the region- Returns:
- the region that was removed
-
dslQuery
public static <T> T dslQuery(com.liferay.petra.sql.dsl.query.DSLQuery dslQuery) -
dslQueryCount
public static int dslQueryCount(com.liferay.petra.sql.dsl.query.DSLQuery dslQuery) -
dynamicQuery
-
dynamicQuery
Performs a dynamic query on the database and returns the matching rows.- Parameters:
dynamicQuery
- the dynamic query- Returns:
- the matching rows
-
dynamicQuery
Performs a dynamic query on the database and returns a range of the matching rows.Useful when paginating results. Returns a maximum of
end - start
instances.start
andend
are not primary keys, they are indexes in the result set. Thus,0
refers to the first result in the set. Setting bothstart
andend
tocom.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS
will return the full result set. IforderByComparator
is specified, then the query will include the given ORDER BY logic. IforderByComparator
is absent, then the query will include the default ORDER BY logic fromcom.liferay.portal.model.impl.RegionModelImpl
.- Parameters:
dynamicQuery
- the dynamic querystart
- the lower bound of the range of model instancesend
- the upper bound of the range of model instances (not inclusive)- Returns:
- the range of matching rows
-
dynamicQuery
public 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.Useful when paginating results. Returns a maximum of
end - start
instances.start
andend
are not primary keys, they are indexes in the result set. Thus,0
refers to the first result in the set. Setting bothstart
andend
tocom.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS
will return the full result set. IforderByComparator
is specified, then the query will include the given ORDER BY logic. IforderByComparator
is absent, then the query will include the default ORDER BY logic fromcom.liferay.portal.model.impl.RegionModelImpl
.- Parameters:
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 (optionallynull
)- Returns:
- the ordered range of matching rows
-
dynamicQueryCount
Returns the number of rows matching the dynamic query.- Parameters:
dynamicQuery
- the dynamic query- Returns:
- the number of rows matching the dynamic query
-
dynamicQueryCount
Returns the number of rows matching the dynamic query.- Parameters:
dynamicQuery
- the dynamic queryprojection
- the projection to apply to the query- Returns:
- the number of rows matching the dynamic query
-
fetchRegion
-
fetchRegion
-
fetchRegionByUuidAndCompanyId
Returns the region with the matching UUID and company.- Parameters:
uuid
- the region's UUIDcompanyId
- the primary key of the company- Returns:
- the matching region, or
null
if a matching region could not be found
-
fetchRegionLocalization
-
getActionableDynamicQuery
-
getExportActionableDynamicQuery
public static ExportActionableDynamicQuery getExportActionableDynamicQuery(PortletDataContext portletDataContext) -
getIndexableActionableDynamicQuery
-
getOSGiServiceIdentifier
Returns the OSGi service identifier.- Returns:
- the OSGi service identifier
-
getPersistedModel
- Throws:
PortalException
-
getRegion
Returns the region with the primary key.- Parameters:
regionId
- the primary key of the region- Returns:
- the region
- Throws:
PortalException
- if a region with the primary key could not be found
-
getRegion
- Throws:
PortalException
-
getRegionByUuidAndCompanyId
public static Region getRegionByUuidAndCompanyId(String uuid, long companyId) throws PortalException Returns the region with the matching UUID and company.- Parameters:
uuid
- the region's UUIDcompanyId
- the primary key of the company- Returns:
- the matching region
- Throws:
PortalException
- if a matching region could not be found
-
getRegionLocalization
public static RegionLocalization getRegionLocalization(long regionId, String languageId) throws PortalException - Throws:
PortalException
-
getRegionLocalizations
-
getRegions
Returns a range of all the regions.Useful when paginating results. Returns a maximum of
end - start
instances.start
andend
are not primary keys, they are indexes in the result set. Thus,0
refers to the first result in the set. Setting bothstart
andend
tocom.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS
will return the full result set. IforderByComparator
is specified, then the query will include the given ORDER BY logic. IforderByComparator
is absent, then the query will include the default ORDER BY logic fromcom.liferay.portal.model.impl.RegionModelImpl
.- Parameters:
start
- the lower bound of the range of regionsend
- the upper bound of the range of regions (not inclusive)- Returns:
- the range of regions
-
getRegions
- Throws:
PortalException
-
getRegions
public static List<Region> getRegions(long countryId, boolean active, int start, int end, OrderByComparator<Region> orderByComparator) -
getRegions
public static List<Region> getRegions(long countryId, int start, int end, OrderByComparator<Region> orderByComparator) -
getRegions
public static List<Region> getRegions(long companyId, String a2, boolean active) throws PortalException - Throws:
PortalException
-
getRegionsCount
public static int getRegionsCount()Returns the number of regions.- Returns:
- the number of regions
-
getRegionsCount
public static int getRegionsCount(long countryId) -
getRegionsCount
public static int getRegionsCount(long countryId, boolean active) -
searchRegions
public static BaseModelSearchResult<Region> searchRegions(long companyId, Boolean active, String keywords, LinkedHashMap<String, Object> params, int start, int end, OrderByComparator<Region> orderByComparator) throws PortalException- Throws:
PortalException
-
updateActive
- Throws:
PortalException
-
updateRegion
public static Region updateRegion(long regionId, boolean active, String name, double position, String regionCode) throws PortalException - Throws:
PortalException
-
updateRegion
Updates the region in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.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.
- Parameters:
region
- the region- Returns:
- the region that was updated
-
updateRegionLocalization
public static RegionLocalization updateRegionLocalization(Region region, String languageId, String title) throws PortalException - Throws:
PortalException
-
updateRegionLocalizations
public static List<RegionLocalization> updateRegionLocalizations(Region region, Map<String, String> titleMap) throws PortalException- Throws:
PortalException
-
getService
-
setService
-