Interface RegionLocalService
- All Superinterfaces:
BaseLocalService
,CTService<Region>
,PersistedModelLocalService
- All Known Implementing Classes:
RegionLocalServiceWrapper
- Author:
- Brian Wing Shun Chan
- See Also:
- {$generated.description}
-
Method Summary
Modifier and TypeMethodDescriptionaddRegion
(long countryId, boolean active, String name, double position, String regionCode, ServiceContext serviceContext) Adds the region to the database.createPersistedModel
(Serializable primaryKeyObj) createRegion
(long regionId) Creates a new region with the primary key.void
deleteCountryRegions
(long countryId) deletePersistedModel
(PersistedModel persistedModel) deleteRegion
(long regionId) Deletes the region with the primary key from the database.deleteRegion
(Region region) Deletes the region from the database.<T> T
dslQuery
(com.liferay.petra.sql.dsl.query.DSLQuery dslQuery) int
dslQueryCount
(com.liferay.petra.sql.dsl.query.DSLQuery dslQuery) <T> List<T>
dynamicQuery
(DynamicQuery dynamicQuery) Performs a dynamic query on the database and returns the matching rows.<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.<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.long
dynamicQueryCount
(DynamicQuery dynamicQuery) Returns the number of rows matching the dynamic query.long
dynamicQueryCount
(DynamicQuery dynamicQuery, Projection projection) Returns the number of rows matching the dynamic query.fetchRegion
(long regionId) fetchRegion
(long countryId, String regionCode) fetchRegionByUuidAndCompanyId
(String uuid, long companyId) Returns the region with the matching UUID and company.fetchRegionLocalization
(long regionId, String languageId) getExportActionableDynamicQuery
(PortletDataContext portletDataContext) Returns the OSGi service identifier.getPersistedModel
(Serializable primaryKeyObj) getRegion
(long regionId) Returns the region with the primary key.getRegionByUuidAndCompanyId
(String uuid, long companyId) Returns the region with the matching UUID and company.getRegionLocalization
(long regionId, String languageId) 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) int
Returns the number of regions.int
getRegionsCount
(long countryId) int
getRegionsCount
(long countryId, boolean active) searchRegions
(long companyId, Boolean active, String keywords, LinkedHashMap<String, Object> params, int start, int end, OrderByComparator<Region> orderByComparator) updateActive
(long regionId, boolean active) updateRegion
(long regionId, boolean active, String name, double position, String regionCode) updateRegion
(Region region) Updates the region in the database or adds it if it does not yet exist.updateRegionLocalization
(Region region, String languageId, String title) updateRegionLocalizations
(Region region, Map<String, String> titleMap) <R,
E extends Throwable>
RupdateWithUnsafeFunction
(com.liferay.petra.function.UnsafeFunction<CTPersistence<Region>, R, E> updateUnsafeFunction) Methods inherited from interface com.liferay.portal.kernel.service.PersistedModelLocalService
fetchPersistedModel, getBasePersistence
-
Method Details
-
addRegion
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
- Specified by:
createPersistedModel
in interfacePersistedModelLocalService
- 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
void deleteCountryRegions(long countryId) -
deletePersistedModel
- Specified by:
deletePersistedModel
in interfacePersistedModelLocalService
- 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
@Transactional(propagation=SUPPORTS, readOnly=true) <T> T dslQuery(com.liferay.petra.sql.dsl.query.DSLQuery dslQuery) - Specified by:
dslQuery
in interfacePersistedModelLocalService
-
dslQueryCount
@Transactional(propagation=SUPPORTS, readOnly=true) int dslQueryCount(com.liferay.petra.sql.dsl.query.DSLQuery dslQuery) - Specified by:
dslQueryCount
in interfacePersistedModelLocalService
-
dynamicQuery
-
dynamicQuery
@Transactional(propagation=SUPPORTS, readOnly=true) <T> List<T> dynamicQuery(DynamicQuery dynamicQuery) Performs a dynamic query on the database and returns the matching rows.- Parameters:
dynamicQuery
- the dynamic query- Returns:
- the matching rows
-
dynamicQuery
@Transactional(propagation=SUPPORTS, readOnly=true) <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.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
@Transactional(propagation=SUPPORTS, readOnly=true) <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
@Transactional(propagation=SUPPORTS, readOnly=true) long dynamicQueryCount(DynamicQuery dynamicQuery) Returns the number of rows matching the dynamic query.- Parameters:
dynamicQuery
- the dynamic query- Returns:
- the number of rows matching the dynamic query
-
dynamicQueryCount
@Transactional(propagation=SUPPORTS, readOnly=true) long dynamicQueryCount(DynamicQuery dynamicQuery, Projection projection) 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
@Transactional(propagation=SUPPORTS, readOnly=true) Region fetchRegion(long countryId, String regionCode) -
fetchRegionByUuidAndCompanyId
@Transactional(propagation=SUPPORTS, readOnly=true) Region fetchRegionByUuidAndCompanyId(String uuid, long companyId) 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
@Transactional(propagation=SUPPORTS, readOnly=true) RegionLocalization fetchRegionLocalization(long regionId, String languageId) -
getActionableDynamicQuery
@Transactional(propagation=SUPPORTS, readOnly=true) ActionableDynamicQuery getActionableDynamicQuery() -
getExportActionableDynamicQuery
@Transactional(propagation=SUPPORTS, readOnly=true) ExportActionableDynamicQuery getExportActionableDynamicQuery(PortletDataContext portletDataContext) -
getIndexableActionableDynamicQuery
@Transactional(propagation=SUPPORTS, readOnly=true) IndexableActionableDynamicQuery getIndexableActionableDynamicQuery() -
getOSGiServiceIdentifier
String getOSGiServiceIdentifier()Returns the OSGi service identifier.- Returns:
- the OSGi service identifier
-
getPersistedModel
@Transactional(propagation=SUPPORTS, readOnly=true) PersistedModel getPersistedModel(Serializable primaryKeyObj) throws PortalException - Specified by:
getPersistedModel
in interfacePersistedModelLocalService
- Throws:
PortalException
-
getRegion
@Transactional(propagation=SUPPORTS, readOnly=true) Region getRegion(long regionId) throws PortalException 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
@Transactional(propagation=SUPPORTS, readOnly=true) Region getRegion(long countryId, String regionCode) throws PortalException - Throws:
PortalException
-
getRegionByUuidAndCompanyId
@Transactional(propagation=SUPPORTS, readOnly=true) 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
@Transactional(propagation=SUPPORTS, readOnly=true) RegionLocalization getRegionLocalization(long regionId, String languageId) throws PortalException - Throws:
PortalException
-
getRegionLocalizations
@Transactional(propagation=SUPPORTS, readOnly=true) List<RegionLocalization> getRegionLocalizations(long regionId) -
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
@Transactional(propagation=SUPPORTS, readOnly=true) List<Region> getRegions(long countryId, boolean active) throws PortalException - Throws:
PortalException
-
getRegions
@Transactional(propagation=SUPPORTS, readOnly=true) List<Region> getRegions(long countryId, boolean active, int start, int end, OrderByComparator<Region> orderByComparator) -
getRegions
@Transactional(propagation=SUPPORTS, readOnly=true) List<Region> getRegions(long countryId, int start, int end, OrderByComparator<Region> orderByComparator) -
getRegions
@Transactional(propagation=SUPPORTS, readOnly=true) List<Region> getRegions(long companyId, String a2, boolean active) throws PortalException - Throws:
PortalException
-
getRegionsCount
Returns the number of regions.- Returns:
- the number of regions
-
getRegionsCount
-
getRegionsCount
@Transactional(propagation=SUPPORTS, readOnly=true) int getRegionsCount(long countryId, boolean active) -
searchRegions
@Transactional(propagation=SUPPORTS, readOnly=true) 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
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
RegionLocalization updateRegionLocalization(Region region, String languageId, String title) throws PortalException - Throws:
PortalException
-
updateRegionLocalizations
List<RegionLocalization> updateRegionLocalizations(Region region, Map<String, String> titleMap) throws PortalException- Throws:
PortalException
-
getCTPersistence
- Specified by:
getCTPersistence
in interfaceCTService<Region>
-
getModelClass
- Specified by:
getModelClass
in interfaceCTService<Region>
-
updateWithUnsafeFunction
@Transactional(rollbackFor=java.lang.Throwable.class) <R,E extends Throwable> R updateWithUnsafeFunction(com.liferay.petra.function.UnsafeFunction<CTPersistence<Region>, R, throws EE> updateUnsafeFunction) - Specified by:
updateWithUnsafeFunction
in interfaceCTService<Region>
- Throws:
E extends Throwable
-