Class CountryLocalServiceUtil
com.liferay.portal.service.impl.CountryLocalServiceImpl
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 Country
addCountry
(Country country) Adds the country to the database.static Country
addCountry
(String a2, String a3, boolean active, boolean billingAllowed, String idd, String name, String number, double position, boolean shippingAllowed, boolean subjectToVAT, boolean zipRequired, ServiceContext serviceContext) static Country
createCountry
(long countryId) Creates a new country with the primary key.static PersistedModel
createPersistedModel
(Serializable primaryKeyObj) static void
deleteCompanyCountries
(long companyId) static Country
deleteCountry
(long countryId) Deletes the country with the primary key from the database.static Country
deleteCountry
(Country country) Deletes the country from the database.static PersistedModel
deletePersistedModel
(PersistedModel persistedModel) 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 Country
fetchCountry
(long countryId) static Country
fetchCountryByA2
(long companyId, String a2) static Country
fetchCountryByA3
(long companyId, String a3) static Country
fetchCountryByName
(long companyId, String name) static Country
fetchCountryByNumber
(long companyId, String number) static Country
fetchCountryByUuidAndCompanyId
(String uuid, long companyId) Returns the country with the matching UUID and company.static CountryLocalization
fetchCountryLocalization
(long countryId, String languageId) static ActionableDynamicQuery
getCompanyCountries
(long companyId) getCompanyCountries
(long companyId, boolean active) getCompanyCountries
(long companyId, boolean active, int start, int end, OrderByComparator<Country> orderByComparator) getCompanyCountries
(long companyId, int start, int end, OrderByComparator<Country> orderByComparator) static int
getCompanyCountriesCount
(long companyId) static int
getCompanyCountriesCount
(long companyId, boolean active) getCountries
(int start, int end) Returns a range of all the countries.static int
Returns the number of countries.static Country
getCountry
(long countryId) Returns the country with the primary key.static Country
getCountryByA2
(long companyId, String a2) static Country
getCountryByA3
(long companyId, String a3) static Country
getCountryByName
(long companyId, String name) static Country
getCountryByNumber
(long companyId, String number) static Country
getCountryByUuidAndCompanyId
(String uuid, long companyId) Returns the country with the matching UUID and company.static CountryLocalization
getCountryLocalization
(long countryId, String languageId) static List<CountryLocalization>
getCountryLocalizations
(long countryId) static ExportActionableDynamicQuery
getExportActionableDynamicQuery
(PortletDataContext portletDataContext) static String
Returns the OSGi service identifier.static PersistedModel
getPersistedModel
(Serializable primaryKeyObj) static CountryLocalService
static BaseModelSearchResult<Country>
searchCountries
(long companyId, Boolean active, String keywords, int start, int end, OrderByComparator<Country> orderByComparator) static void
setService
(CountryLocalService service) static Country
updateActive
(long countryId, boolean active) static Country
updateCountry
(long countryId, String a2, String a3, boolean active, boolean billingAllowed, String idd, String name, String number, double position, boolean shippingAllowed, boolean subjectToVAT) static Country
updateCountry
(Country country) Updates the country in the database or adds it if it does not yet exist.static CountryLocalization
updateCountryLocalization
(Country country, String languageId, String title) static List<CountryLocalization>
updateCountryLocalizations
(Country country, Map<String, String> titleMap) static Country
updateGroupFilterEnabled
(long countryId, boolean groupFilterEnabled)
-
Constructor Details
-
CountryLocalServiceUtil
public CountryLocalServiceUtil()
-
-
Method Details
-
addCountry
Adds the country to the database. Also notifies the appropriate model listeners.Important: Inspect CountryLocalServiceImpl 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:
country
- the country- Returns:
- the country that was added
-
addCountry
public static Country addCountry(String a2, String a3, boolean active, boolean billingAllowed, String idd, String name, String number, double position, boolean shippingAllowed, boolean subjectToVAT, boolean zipRequired, ServiceContext serviceContext) throws PortalException - Throws:
PortalException
-
createCountry
Creates a new country with the primary key. Does not add the country to the database.- Parameters:
countryId
- the primary key for the new country- Returns:
- the new country
-
createPersistedModel
public static PersistedModel createPersistedModel(Serializable primaryKeyObj) throws PortalException - Throws:
PortalException
-
deleteCompanyCountries
- Throws:
PortalException
-
deleteCountry
Deletes the country from the database. Also notifies the appropriate model listeners.Important: Inspect CountryLocalServiceImpl 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:
country
- the country- Returns:
- the country that was removed
- Throws:
PortalException
-
deleteCountry
Deletes the country with the primary key from the database. Also notifies the appropriate model listeners.Important: Inspect CountryLocalServiceImpl 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:
countryId
- the primary key of the country- Returns:
- the country that was removed
- Throws:
PortalException
- if a country with the primary key could not be found
-
deletePersistedModel
public static PersistedModel deletePersistedModel(PersistedModel persistedModel) throws PortalException - Throws:
PortalException
-
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.CountryModelImpl
.- 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.CountryModelImpl
.- 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
-
fetchCountry
-
fetchCountryByA2
-
fetchCountryByA3
-
fetchCountryByName
-
fetchCountryByNumber
-
fetchCountryByUuidAndCompanyId
Returns the country with the matching UUID and company.- Parameters:
uuid
- the country's UUIDcompanyId
- the primary key of the company- Returns:
- the matching country, or
null
if a matching country could not be found
-
fetchCountryLocalization
-
getActionableDynamicQuery
-
getCompanyCountries
-
getCompanyCountries
-
getCompanyCountries
public static List<Country> getCompanyCountries(long companyId, boolean active, int start, int end, OrderByComparator<Country> orderByComparator) -
getCompanyCountries
public static List<Country> getCompanyCountries(long companyId, int start, int end, OrderByComparator<Country> orderByComparator) -
getCompanyCountriesCount
public static int getCompanyCountriesCount(long companyId) -
getCompanyCountriesCount
public static int getCompanyCountriesCount(long companyId, boolean active) -
getCountries
Returns a range of all the countries.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.CountryModelImpl
.- Parameters:
start
- the lower bound of the range of countriesend
- the upper bound of the range of countries (not inclusive)- Returns:
- the range of countries
-
getCountriesCount
public static int getCountriesCount()Returns the number of countries.- Returns:
- the number of countries
-
getCountry
Returns the country with the primary key.- Parameters:
countryId
- the primary key of the country- Returns:
- the country
- Throws:
PortalException
- if a country with the primary key could not be found
-
getCountryByA2
- Throws:
PortalException
-
getCountryByA3
- Throws:
PortalException
-
getCountryByName
- Throws:
PortalException
-
getCountryByNumber
- Throws:
PortalException
-
getCountryByUuidAndCompanyId
public static Country getCountryByUuidAndCompanyId(String uuid, long companyId) throws PortalException Returns the country with the matching UUID and company.- Parameters:
uuid
- the country's UUIDcompanyId
- the primary key of the company- Returns:
- the matching country
- Throws:
PortalException
- if a matching country could not be found
-
getCountryLocalization
public static CountryLocalization getCountryLocalization(long countryId, String languageId) throws PortalException - Throws:
PortalException
-
getCountryLocalizations
-
getExportActionableDynamicQuery
public static ExportActionableDynamicQuery getExportActionableDynamicQuery(PortletDataContext portletDataContext) -
getIndexableActionableDynamicQuery
-
getOSGiServiceIdentifier
Returns the OSGi service identifier.- Returns:
- the OSGi service identifier
-
getPersistedModel
- Throws:
PortalException
-
searchCountries
public static BaseModelSearchResult<Country> searchCountries(long companyId, Boolean active, String keywords, int start, int end, OrderByComparator<Country> orderByComparator) throws PortalException - Throws:
PortalException
-
updateActive
- Throws:
PortalException
-
updateCountry
Updates the country in the database or adds it if it does not yet exist. Also notifies the appropriate model listeners.Important: Inspect CountryLocalServiceImpl 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:
country
- the country- Returns:
- the country that was updated
-
updateCountry
public static Country updateCountry(long countryId, String a2, String a3, boolean active, boolean billingAllowed, String idd, String name, String number, double position, boolean shippingAllowed, boolean subjectToVAT) throws PortalException - Throws:
PortalException
-
updateCountryLocalization
public static CountryLocalization updateCountryLocalization(Country country, String languageId, String title) throws PortalException - Throws:
PortalException
-
updateCountryLocalizations
public static List<CountryLocalization> updateCountryLocalizations(Country country, Map<String, String> titleMap) throws PortalException- Throws:
PortalException
-
updateGroupFilterEnabled
public static Country updateGroupFilterEnabled(long countryId, boolean groupFilterEnabled) throws PortalException - Throws:
PortalException
-
getService
-
setService
-