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 RegionaddRegion(long countryId, boolean active, String name, double position, String regionCode, ServiceContext serviceContext) static RegionAdds the region to the database.static PersistedModelcreatePersistedModel(Serializable primaryKeyObj) static RegioncreateRegion(long regionId) Creates a new region with the primary key.static voiddeleteCountryRegions(long countryId) static PersistedModeldeletePersistedModel(PersistedModel persistedModel) static RegiondeleteRegion(long regionId) Deletes the region with the primary key from the database.static RegiondeleteRegion(Region region) Deletes the region from the database.static <T> TdslQuery(com.liferay.petra.sql.dsl.query.DSLQuery dslQuery) static intdslQueryCount(com.liferay.petra.sql.dsl.query.DSLQuery dslQuery) static DynamicQuerystatic <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 longdynamicQueryCount(DynamicQuery dynamicQuery) Returns the number of rows matching the dynamic query.static longdynamicQueryCount(DynamicQuery dynamicQuery, Projection projection) Returns the number of rows matching the dynamic query.static RegionfetchRegion(long regionId) static RegionfetchRegion(long countryId, String regionCode) static RegionfetchRegionByUuidAndCompanyId(String uuid, long companyId) Returns the region with the matching UUID and company.static RegionLocalizationfetchRegionLocalization(long regionId, String languageId) static ActionableDynamicQuerystatic ExportActionableDynamicQuerygetExportActionableDynamicQuery(PortletDataContext portletDataContext) static StringReturns the OSGi service identifier.static PersistedModelgetPersistedModel(Serializable primaryKeyObj) static RegiongetRegion(long regionId) Returns the region with the primary key.static Regionstatic RegiongetRegionByUuidAndCompanyId(String uuid, long companyId) Returns the region with the matching UUID and company.static RegionLocalizationgetRegionLocalization(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 intReturns the number of regions.static intgetRegionsCount(long countryId) static intgetRegionsCount(long countryId, boolean active) static RegionLocalServicestatic BaseModelSearchResult<Region>searchRegions(long companyId, Boolean active, String keywords, LinkedHashMap<String, Object> params, int start, int end, OrderByComparator<Region> orderByComparator) static voidsetService(RegionLocalService service) static RegionupdateActive(long regionId, boolean active) static RegionupdateRegion(long regionId, boolean active, String name, double position, String regionCode) static RegionupdateRegion(Region region) Updates the region in the database or adds it if it does not yet exist.static RegionLocalizationupdateRegionLocalization(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 - startinstances.startandendare not primary keys, they are indexes in the result set. Thus,0refers to the first result in the set. Setting bothstartandendtocom.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POSwill return the full result set. IforderByComparatoris specified, then the query will include the given ORDER BY logic. IforderByComparatoris 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 - startinstances.startandendare not primary keys, they are indexes in the result set. Thus,0refers to the first result in the set. Setting bothstartandendtocom.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POSwill return the full result set. IforderByComparatoris specified, then the query will include the given ORDER BY logic. IforderByComparatoris 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
nullif 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 - startinstances.startandendare not primary keys, they are indexes in the result set. Thus,0refers to the first result in the set. Setting bothstartandendtocom.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POSwill return the full result set. IforderByComparatoris specified, then the query will include the given ORDER BY logic. IforderByComparatoris 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
-