Class CommerceDiscountRuleUtil

java.lang.Object
com.liferay.commerce.discount.service.persistence.CommerceDiscountRuleUtil

public class CommerceDiscountRuleUtil extends Object
The persistence utility for the commerce discount rule service. This utility wraps com.liferay.commerce.discount.service.persistence.impl.CommerceDiscountRulePersistenceImpl and provides direct access to the database for CRUD operations. This utility should only be used by the service layer, as it must operate within a transaction. Never access this utility in a JSP, controller, model, or other front-end class.

Caching information and settings can be found in portal.properties

See Also:
Generated:
  • Constructor Details

    • CommerceDiscountRuleUtil

      public CommerceDiscountRuleUtil()
  • Method Details

    • clearCache

      public static void clearCache()
      See Also:
      • BasePersistence.clearCache()
    • clearCache

      public static void clearCache(CommerceDiscountRule commerceDiscountRule)
      See Also:
      • BasePersistence.clearCache(com.liferay.portal.kernel.model.BaseModel)
    • countWithDynamicQuery

      public static long countWithDynamicQuery(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
      See Also:
      • BasePersistence.countWithDynamicQuery(DynamicQuery)
    • fetchByPrimaryKeys

      public static Map<Serializable,CommerceDiscountRule> fetchByPrimaryKeys(Set<Serializable> primaryKeys)
      See Also:
      • BasePersistence.fetchByPrimaryKeys(Set)
    • findWithDynamicQuery

      public static List<CommerceDiscountRule> findWithDynamicQuery(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
      See Also:
      • BasePersistence.findWithDynamicQuery(DynamicQuery)
    • findWithDynamicQuery

      public static List<CommerceDiscountRule> findWithDynamicQuery(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, int end)
      See Also:
      • BasePersistence.findWithDynamicQuery(DynamicQuery, int, int)
    • findWithDynamicQuery

      public static List<CommerceDiscountRule> findWithDynamicQuery(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<CommerceDiscountRule> orderByComparator)
      See Also:
      • BasePersistence.findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator)
    • update

      public static CommerceDiscountRule update(CommerceDiscountRule commerceDiscountRule)
      See Also:
      • BasePersistence.update(com.liferay.portal.kernel.model.BaseModel)
    • update

      public static CommerceDiscountRule update(CommerceDiscountRule commerceDiscountRule, com.liferay.portal.kernel.service.ServiceContext serviceContext)
      See Also:
      • BasePersistence.update(com.liferay.portal.kernel.model.BaseModel, ServiceContext)
    • findByCommerceDiscountId

      public static List<CommerceDiscountRule> findByCommerceDiscountId(long commerceDiscountId)
      Returns all the commerce discount rules where commerceDiscountId = ?.
      Parameters:
      commerceDiscountId - the commerce discount ID
      Returns:
      the matching commerce discount rules
    • findByCommerceDiscountId

      public static List<CommerceDiscountRule> findByCommerceDiscountId(long commerceDiscountId, int start, int end)
      Returns a range of all the commerce discount rules where commerceDiscountId = ?.

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

      Parameters:
      commerceDiscountId - the commerce discount ID
      start - the lower bound of the range of commerce discount rules
      end - the upper bound of the range of commerce discount rules (not inclusive)
      Returns:
      the range of matching commerce discount rules
    • findByCommerceDiscountId

      public static List<CommerceDiscountRule> findByCommerceDiscountId(long commerceDiscountId, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<CommerceDiscountRule> orderByComparator)
      Returns an ordered range of all the commerce discount rules where commerceDiscountId = ?.

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

      Parameters:
      commerceDiscountId - the commerce discount ID
      start - the lower bound of the range of commerce discount rules
      end - the upper bound of the range of commerce discount rules (not inclusive)
      orderByComparator - the comparator to order the results by (optionally null)
      Returns:
      the ordered range of matching commerce discount rules
    • findByCommerceDiscountId

      public static List<CommerceDiscountRule> findByCommerceDiscountId(long commerceDiscountId, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<CommerceDiscountRule> orderByComparator, boolean useFinderCache)
      Returns an ordered range of all the commerce discount rules where commerceDiscountId = ?.

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

      Parameters:
      commerceDiscountId - the commerce discount ID
      start - the lower bound of the range of commerce discount rules
      end - the upper bound of the range of commerce discount rules (not inclusive)
      orderByComparator - the comparator to order the results by (optionally null)
      useFinderCache - whether to use the finder cache
      Returns:
      the ordered range of matching commerce discount rules
    • findByCommerceDiscountId_First

      public static CommerceDiscountRule findByCommerceDiscountId_First(long commerceDiscountId, com.liferay.portal.kernel.util.OrderByComparator<CommerceDiscountRule> orderByComparator) throws NoSuchDiscountRuleException
      Returns the first commerce discount rule in the ordered set where commerceDiscountId = ?.
      Parameters:
      commerceDiscountId - the commerce discount ID
      orderByComparator - the comparator to order the set by (optionally null)
      Returns:
      the first matching commerce discount rule
      Throws:
      NoSuchDiscountRuleException - if a matching commerce discount rule could not be found
      NoSuchDiscountRuleException
    • fetchByCommerceDiscountId_First

      public static CommerceDiscountRule fetchByCommerceDiscountId_First(long commerceDiscountId, com.liferay.portal.kernel.util.OrderByComparator<CommerceDiscountRule> orderByComparator)
      Returns the first commerce discount rule in the ordered set where commerceDiscountId = ?.
      Parameters:
      commerceDiscountId - the commerce discount ID
      orderByComparator - the comparator to order the set by (optionally null)
      Returns:
      the first matching commerce discount rule, or null if a matching commerce discount rule could not be found
    • findByCommerceDiscountId_Last

      public static CommerceDiscountRule findByCommerceDiscountId_Last(long commerceDiscountId, com.liferay.portal.kernel.util.OrderByComparator<CommerceDiscountRule> orderByComparator) throws NoSuchDiscountRuleException
      Returns the last commerce discount rule in the ordered set where commerceDiscountId = ?.
      Parameters:
      commerceDiscountId - the commerce discount ID
      orderByComparator - the comparator to order the set by (optionally null)
      Returns:
      the last matching commerce discount rule
      Throws:
      NoSuchDiscountRuleException - if a matching commerce discount rule could not be found
      NoSuchDiscountRuleException
    • fetchByCommerceDiscountId_Last

      public static CommerceDiscountRule fetchByCommerceDiscountId_Last(long commerceDiscountId, com.liferay.portal.kernel.util.OrderByComparator<CommerceDiscountRule> orderByComparator)
      Returns the last commerce discount rule in the ordered set where commerceDiscountId = ?.
      Parameters:
      commerceDiscountId - the commerce discount ID
      orderByComparator - the comparator to order the set by (optionally null)
      Returns:
      the last matching commerce discount rule, or null if a matching commerce discount rule could not be found
    • findByCommerceDiscountId_PrevAndNext

      public static CommerceDiscountRule[] findByCommerceDiscountId_PrevAndNext(long commerceDiscountRuleId, long commerceDiscountId, com.liferay.portal.kernel.util.OrderByComparator<CommerceDiscountRule> orderByComparator) throws NoSuchDiscountRuleException
      Returns the commerce discount rules before and after the current commerce discount rule in the ordered set where commerceDiscountId = ?.
      Parameters:
      commerceDiscountRuleId - the primary key of the current commerce discount rule
      commerceDiscountId - the commerce discount ID
      orderByComparator - the comparator to order the set by (optionally null)
      Returns:
      the previous, current, and next commerce discount rule
      Throws:
      NoSuchDiscountRuleException - if a commerce discount rule with the primary key could not be found
      NoSuchDiscountRuleException
    • removeByCommerceDiscountId

      public static void removeByCommerceDiscountId(long commerceDiscountId)
      Removes all the commerce discount rules where commerceDiscountId = ? from the database.
      Parameters:
      commerceDiscountId - the commerce discount ID
    • countByCommerceDiscountId

      public static int countByCommerceDiscountId(long commerceDiscountId)
      Returns the number of commerce discount rules where commerceDiscountId = ?.
      Parameters:
      commerceDiscountId - the commerce discount ID
      Returns:
      the number of matching commerce discount rules
    • cacheResult

      public static void cacheResult(CommerceDiscountRule commerceDiscountRule)
      Caches the commerce discount rule in the entity cache if it is enabled.
      Parameters:
      commerceDiscountRule - the commerce discount rule
    • cacheResult

      public static void cacheResult(List<CommerceDiscountRule> commerceDiscountRules)
      Caches the commerce discount rules in the entity cache if it is enabled.
      Parameters:
      commerceDiscountRules - the commerce discount rules
    • create

      public static CommerceDiscountRule create(long commerceDiscountRuleId)
      Creates a new commerce discount rule with the primary key. Does not add the commerce discount rule to the database.
      Parameters:
      commerceDiscountRuleId - the primary key for the new commerce discount rule
      Returns:
      the new commerce discount rule
    • remove

      public static CommerceDiscountRule remove(long commerceDiscountRuleId) throws NoSuchDiscountRuleException
      Removes the commerce discount rule with the primary key from the database. Also notifies the appropriate model listeners.
      Parameters:
      commerceDiscountRuleId - the primary key of the commerce discount rule
      Returns:
      the commerce discount rule that was removed
      Throws:
      NoSuchDiscountRuleException - if a commerce discount rule with the primary key could not be found
      NoSuchDiscountRuleException
    • updateImpl

      public static CommerceDiscountRule updateImpl(CommerceDiscountRule commerceDiscountRule)
    • findByPrimaryKey

      public static CommerceDiscountRule findByPrimaryKey(long commerceDiscountRuleId) throws NoSuchDiscountRuleException
      Returns the commerce discount rule with the primary key or throws a NoSuchDiscountRuleException if it could not be found.
      Parameters:
      commerceDiscountRuleId - the primary key of the commerce discount rule
      Returns:
      the commerce discount rule
      Throws:
      NoSuchDiscountRuleException - if a commerce discount rule with the primary key could not be found
      NoSuchDiscountRuleException
    • fetchByPrimaryKey

      public static CommerceDiscountRule fetchByPrimaryKey(long commerceDiscountRuleId)
      Returns the commerce discount rule with the primary key or returns null if it could not be found.
      Parameters:
      commerceDiscountRuleId - the primary key of the commerce discount rule
      Returns:
      the commerce discount rule, or null if a commerce discount rule with the primary key could not be found
    • findAll

      public static List<CommerceDiscountRule> findAll()
      Returns all the commerce discount rules.
      Returns:
      the commerce discount rules
    • findAll

      public static List<CommerceDiscountRule> findAll(int start, int end)
      Returns a range of all the commerce discount rules.

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

      Parameters:
      start - the lower bound of the range of commerce discount rules
      end - the upper bound of the range of commerce discount rules (not inclusive)
      Returns:
      the range of commerce discount rules
    • findAll

      public static List<CommerceDiscountRule> findAll(int start, int end, com.liferay.portal.kernel.util.OrderByComparator<CommerceDiscountRule> orderByComparator)
      Returns an ordered range of all the commerce discount rules.

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

      Parameters:
      start - the lower bound of the range of commerce discount rules
      end - the upper bound of the range of commerce discount rules (not inclusive)
      orderByComparator - the comparator to order the results by (optionally null)
      Returns:
      the ordered range of commerce discount rules
    • findAll

      public static List<CommerceDiscountRule> findAll(int start, int end, com.liferay.portal.kernel.util.OrderByComparator<CommerceDiscountRule> orderByComparator, boolean useFinderCache)
      Returns an ordered range of all the commerce discount rules.

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

      Parameters:
      start - the lower bound of the range of commerce discount rules
      end - the upper bound of the range of commerce discount rules (not inclusive)
      orderByComparator - the comparator to order the results by (optionally null)
      useFinderCache - whether to use the finder cache
      Returns:
      the ordered range of commerce discount rules
    • removeAll

      public static void removeAll()
      Removes all the commerce discount rules from the database.
    • countAll

      public static int countAll()
      Returns the number of commerce discount rules.
      Returns:
      the number of commerce discount rules
    • getPersistence

      public static CommerceDiscountRulePersistence getPersistence()
    • setPersistence

      public static void setPersistence(CommerceDiscountRulePersistence persistence)