Class CountryLocalServiceUtil

Object
com.liferay.portal.kernel.service.CountryLocalServiceUtil

public class CountryLocalServiceUtil extends Object
Provides the local service utility for Country. This utility wraps 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 Details

    • CountryLocalServiceUtil

      public CountryLocalServiceUtil()
  • Method Details

    • addCountry

      public static Country addCountry(Country country)
      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

      public static Country createCountry(long countryId)
      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

      public static void deleteCompanyCountries(long companyId) throws PortalException
      Throws:
      PortalException
    • deleteCountry

      public static Country deleteCountry(Country country) throws PortalException
      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

      public static Country deleteCountry(long countryId) throws PortalException
      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

      public static DynamicQuery dynamicQuery()
    • dynamicQuery

      public static <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

      public 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.

      Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent, then the query will include the default ORDER BY logic from com.liferay.portal.model.impl.CountryModelImpl.

      Parameters:
      dynamicQuery - the dynamic query
      start - the lower bound of the range of model instances
      end - 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 and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent, then the query will include the default ORDER BY logic from com.liferay.portal.model.impl.CountryModelImpl.

      Parameters:
      dynamicQuery - the dynamic query
      start - the lower bound of the range of model instances
      end - the upper bound of the range of model instances (not inclusive)
      orderByComparator - the comparator to order the results by (optionally null)
      Returns:
      the ordered range of matching rows
    • dynamicQueryCount

      public static 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

      public static long dynamicQueryCount(DynamicQuery dynamicQuery, Projection projection)
      Returns the number of rows matching the dynamic query.
      Parameters:
      dynamicQuery - the dynamic query
      projection - the projection to apply to the query
      Returns:
      the number of rows matching the dynamic query
    • fetchCountry

      public static Country fetchCountry(long countryId)
    • fetchCountryByA2

      public static Country fetchCountryByA2(long companyId, String a2)
    • fetchCountryByA3

      public static Country fetchCountryByA3(long companyId, String a3)
    • fetchCountryByName

      public static Country fetchCountryByName(long companyId, String name)
    • fetchCountryByNumber

      public static Country fetchCountryByNumber(long companyId, String number)
    • fetchCountryByUuidAndCompanyId

      public static Country fetchCountryByUuidAndCompanyId(String uuid, long companyId)
      Returns the country with the matching UUID and company.
      Parameters:
      uuid - the country's UUID
      companyId - the primary key of the company
      Returns:
      the matching country, or null if a matching country could not be found
    • fetchCountryLocalization

      public static CountryLocalization fetchCountryLocalization(long countryId, String languageId)
    • getActionableDynamicQuery

      public static ActionableDynamicQuery getActionableDynamicQuery()
    • getCompanyCountries

      public static List<Country> getCompanyCountries(long companyId)
    • getCompanyCountries

      public static List<Country> getCompanyCountries(long companyId, boolean active)
    • 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

      public static List<Country> getCountries(int start, int end)
      Returns a range of all the countries.

      Useful when paginating results. Returns a maximum of end - start instances. start and end are not primary keys, they are indexes in the result set. Thus, 0 refers to the first result in the set. Setting both start and end to com.liferay.portal.kernel.dao.orm.QueryUtil#ALL_POS will return the full result set. If orderByComparator is specified, then the query will include the given ORDER BY logic. If orderByComparator is absent, then the query will include the default ORDER BY logic from com.liferay.portal.model.impl.CountryModelImpl.

      Parameters:
      start - the lower bound of the range of countries
      end - 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

      public static Country getCountry(long countryId) throws PortalException
      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

      public static Country getCountryByA2(long companyId, String a2) throws PortalException
      Throws:
      PortalException
    • getCountryByA3

      public static Country getCountryByA3(long companyId, String a3) throws PortalException
      Throws:
      PortalException
    • getCountryByName

      public static Country getCountryByName(long companyId, String name) throws PortalException
      Throws:
      PortalException
    • getCountryByNumber

      public static Country getCountryByNumber(long companyId, String number) throws PortalException
      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 UUID
      companyId - 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

      public static List<CountryLocalization> getCountryLocalizations(long countryId)
    • getExportActionableDynamicQuery

      public static ExportActionableDynamicQuery getExportActionableDynamicQuery(PortletDataContext portletDataContext)
    • getIndexableActionableDynamicQuery

      public static IndexableActionableDynamicQuery getIndexableActionableDynamicQuery()
    • getOSGiServiceIdentifier

      public static String getOSGiServiceIdentifier()
      Returns the OSGi service identifier.
      Returns:
      the OSGi service identifier
    • getPersistedModel

      public static PersistedModel getPersistedModel(Serializable primaryKeyObj) throws PortalException
      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

      public static Country updateActive(long countryId, boolean active) throws PortalException
      Throws:
      PortalException
    • updateCountry

      public static Country updateCountry(Country country)
      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

      public static CountryLocalService getService()
    • setService

      public static void setService(CountryLocalService service)