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 CountryaddCountry(Country country) Adds the country to the database.static CountryaddCountry(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 CountrycreateCountry(long countryId) Creates a new country with the primary key.static PersistedModelcreatePersistedModel(Serializable primaryKeyObj) static voiddeleteCompanyCountries(long companyId) static CountrydeleteCountry(long countryId) Deletes the country with the primary key from the database.static CountrydeleteCountry(Country country) Deletes the country from the database.static PersistedModeldeletePersistedModel(PersistedModel persistedModel) 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 CountryfetchCountry(long countryId) static CountryfetchCountryByA2(long companyId, String a2) static CountryfetchCountryByA3(long companyId, String a3) static CountryfetchCountryByName(long companyId, String name) static CountryfetchCountryByNumber(long companyId, String number) static CountryfetchCountryByUuidAndCompanyId(String uuid, long companyId) Returns the country with the matching UUID and company.static CountryLocalizationfetchCountryLocalization(long countryId, String languageId) static ActionableDynamicQuerygetCompanyCountries(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 intgetCompanyCountriesCount(long companyId) static intgetCompanyCountriesCount(long companyId, boolean active) getCountries(int start, int end) Returns a range of all the countries.static intReturns the number of countries.static CountrygetCountry(long countryId) Returns the country with the primary key.static CountrygetCountryByA2(long companyId, String a2) static CountrygetCountryByA3(long companyId, String a3) static CountrygetCountryByName(long companyId, String name) static CountrygetCountryByNumber(long companyId, String number) static CountrygetCountryByUuidAndCompanyId(String uuid, long companyId) Returns the country with the matching UUID and company.static CountryLocalizationgetCountryLocalization(long countryId, String languageId) static List<CountryLocalization>getCountryLocalizations(long countryId) static ExportActionableDynamicQuerygetExportActionableDynamicQuery(PortletDataContext portletDataContext) static StringReturns the OSGi service identifier.static PersistedModelgetPersistedModel(Serializable primaryKeyObj) static CountryLocalServicestatic BaseModelSearchResult<Country>searchCountries(long companyId, Boolean active, String keywords, int start, int end, OrderByComparator<Country> orderByComparator) static voidsetService(CountryLocalService service) static CountryupdateActive(long countryId, boolean active) static CountryupdateCountry(long countryId, String a2, String a3, boolean active, boolean billingAllowed, String idd, String name, String number, double position, boolean shippingAllowed, boolean subjectToVAT) static CountryupdateCountry(Country country) Updates the country in the database or adds it if it does not yet exist.static CountryLocalizationupdateCountryLocalization(Country country, String languageId, String title) static List<CountryLocalization>updateCountryLocalizations(Country country, Map<String, String> titleMap) static CountryupdateGroupFilterEnabled(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 - 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.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 - 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.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
nullif 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 - 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.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
-