Class CommerceDiscountRuleUtil
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 Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic voidcacheResult(CommerceDiscountRule commerceDiscountRule) Caches the commerce discount rule in the entity cache if it is enabled.static voidcacheResult(List<CommerceDiscountRule> commerceDiscountRules) Caches the commerce discount rules in the entity cache if it is enabled.static voidstatic voidclearCache(CommerceDiscountRule commerceDiscountRule) static intcountAll()Returns the number of commerce discount rules.static intcountByCommerceDiscountId(long commerceDiscountId) Returns the number of commerce discount rules where commerceDiscountId = ?.static longcountWithDynamicQuery(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) static CommerceDiscountRulecreate(long commerceDiscountRuleId) Creates a new commerce discount rule with the primary key.static CommerceDiscountRulefetchByCommerceDiscountId_First(long commerceDiscountId, com.liferay.portal.kernel.util.OrderByComparator<CommerceDiscountRule> orderByComparator) Returns the first commerce discount rule in the ordered set where commerceDiscountId = ?.static CommerceDiscountRulefetchByCommerceDiscountId_Last(long commerceDiscountId, com.liferay.portal.kernel.util.OrderByComparator<CommerceDiscountRule> orderByComparator) Returns the last commerce discount rule in the ordered set where commerceDiscountId = ?.static CommerceDiscountRulefetchByPrimaryKey(long commerceDiscountRuleId) Returns the commerce discount rule with the primary key or returnsnullif it could not be found.static Map<Serializable,CommerceDiscountRule> fetchByPrimaryKeys(Set<Serializable> primaryKeys) static List<CommerceDiscountRule>findAll()Returns all the commerce discount rules.static List<CommerceDiscountRule>findAll(int start, int end) Returns a range of all the commerce discount rules.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.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.static List<CommerceDiscountRule>findByCommerceDiscountId(long commerceDiscountId) Returns all the commerce discount rules where commerceDiscountId = ?.static List<CommerceDiscountRule>findByCommerceDiscountId(long commerceDiscountId, int start, int end) Returns a range of all the commerce discount rules where commerceDiscountId = ?.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 = ?.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 = ?.static CommerceDiscountRulefindByCommerceDiscountId_First(long commerceDiscountId, com.liferay.portal.kernel.util.OrderByComparator<CommerceDiscountRule> orderByComparator) Returns the first commerce discount rule in the ordered set where commerceDiscountId = ?.static CommerceDiscountRulefindByCommerceDiscountId_Last(long commerceDiscountId, com.liferay.portal.kernel.util.OrderByComparator<CommerceDiscountRule> orderByComparator) Returns the last commerce discount rule in the ordered set where commerceDiscountId = ?.static CommerceDiscountRule[]findByCommerceDiscountId_PrevAndNext(long commerceDiscountRuleId, long commerceDiscountId, com.liferay.portal.kernel.util.OrderByComparator<CommerceDiscountRule> orderByComparator) Returns the commerce discount rules before and after the current commerce discount rule in the ordered set where commerceDiscountId = ?.static CommerceDiscountRulefindByPrimaryKey(long commerceDiscountRuleId) Returns the commerce discount rule with the primary key or throws aNoSuchDiscountRuleExceptionif it could not be found.static List<CommerceDiscountRule>findWithDynamicQuery(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) static List<CommerceDiscountRule>findWithDynamicQuery(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, int end) static List<CommerceDiscountRule>findWithDynamicQuery(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<CommerceDiscountRule> orderByComparator) static CommerceDiscountRuleremove(long commerceDiscountRuleId) Removes the commerce discount rule with the primary key from the database.static voidRemoves all the commerce discount rules from the database.static voidremoveByCommerceDiscountId(long commerceDiscountId) Removes all the commerce discount rules where commerceDiscountId = ? from the database.static voidsetPersistence(CommerceDiscountRulePersistence persistence) static CommerceDiscountRuleupdate(CommerceDiscountRule commerceDiscountRule) static CommerceDiscountRuleupdate(CommerceDiscountRule commerceDiscountRule, com.liferay.portal.kernel.service.ServiceContext serviceContext) static CommerceDiscountRuleupdateImpl(CommerceDiscountRule commerceDiscountRule)
-
Constructor Details
-
CommerceDiscountRuleUtil
public CommerceDiscountRuleUtil()
-
-
Method Details
-
clearCache
public static void clearCache()- See Also:
-
BasePersistence.clearCache()
-
clearCache
- 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
- 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
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 - startinstances.startandendare not primary keys, they are indexes in the result set. Thus,0refers to the first result in the set. Setting bothstartandendtoQueryUtil#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 fromCommerceDiscountRuleModelImpl.- Parameters:
commerceDiscountId- the commerce discount IDstart- the lower bound of the range of commerce discount rulesend- 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 - startinstances.startandendare not primary keys, they are indexes in the result set. Thus,0refers to the first result in the set. Setting bothstartandendtoQueryUtil#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 fromCommerceDiscountRuleModelImpl.- Parameters:
commerceDiscountId- the commerce discount IDstart- the lower bound of the range of commerce discount rulesend- the upper bound of the range of commerce discount rules (not inclusive)orderByComparator- the comparator to order the results by (optionallynull)- 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 - startinstances.startandendare not primary keys, they are indexes in the result set. Thus,0refers to the first result in the set. Setting bothstartandendtoQueryUtil#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 fromCommerceDiscountRuleModelImpl.- Parameters:
commerceDiscountId- the commerce discount IDstart- the lower bound of the range of commerce discount rulesend- the upper bound of the range of commerce discount rules (not inclusive)orderByComparator- the comparator to order the results by (optionallynull)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 IDorderByComparator- the comparator to order the set by (optionallynull)- Returns:
- the first matching commerce discount rule
- Throws:
NoSuchDiscountRuleException- if a matching commerce discount rule could not be foundNoSuchDiscountRuleException
-
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 IDorderByComparator- the comparator to order the set by (optionallynull)- Returns:
- the first matching commerce discount rule, or
nullif 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 IDorderByComparator- the comparator to order the set by (optionallynull)- Returns:
- the last matching commerce discount rule
- Throws:
NoSuchDiscountRuleException- if a matching commerce discount rule could not be foundNoSuchDiscountRuleException
-
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 IDorderByComparator- the comparator to order the set by (optionallynull)- Returns:
- the last matching commerce discount rule, or
nullif 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 rulecommerceDiscountId- the commerce discount IDorderByComparator- the comparator to order the set by (optionallynull)- Returns:
- the previous, current, and next commerce discount rule
- Throws:
NoSuchDiscountRuleException- if a commerce discount rule with the primary key could not be foundNoSuchDiscountRuleException
-
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
Caches the commerce discount rule in the entity cache if it is enabled.- Parameters:
commerceDiscountRule- the commerce discount rule
-
cacheResult
Caches the commerce discount rules in the entity cache if it is enabled.- Parameters:
commerceDiscountRules- the commerce discount rules
-
create
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 foundNoSuchDiscountRuleException
-
updateImpl
-
findByPrimaryKey
public static CommerceDiscountRule findByPrimaryKey(long commerceDiscountRuleId) throws NoSuchDiscountRuleException Returns the commerce discount rule with the primary key or throws aNoSuchDiscountRuleExceptionif 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 foundNoSuchDiscountRuleException
-
fetchByPrimaryKey
Returns the commerce discount rule with the primary key or returnsnullif it could not be found.- Parameters:
commerceDiscountRuleId- the primary key of the commerce discount rule- Returns:
- the commerce discount rule, or
nullif a commerce discount rule with the primary key could not be found
-
findAll
Returns all the commerce discount rules.- Returns:
- the commerce discount rules
-
findAll
Returns a range of all the commerce discount rules.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 bothstartandendtoQueryUtil#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 fromCommerceDiscountRuleModelImpl.- Parameters:
start- the lower bound of the range of commerce discount rulesend- 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 - startinstances.startandendare not primary keys, they are indexes in the result set. Thus,0refers to the first result in the set. Setting bothstartandendtoQueryUtil#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 fromCommerceDiscountRuleModelImpl.- Parameters:
start- the lower bound of the range of commerce discount rulesend- the upper bound of the range of commerce discount rules (not inclusive)orderByComparator- the comparator to order the results by (optionallynull)- 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 - startinstances.startandendare not primary keys, they are indexes in the result set. Thus,0refers to the first result in the set. Setting bothstartandendtoQueryUtil#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 fromCommerceDiscountRuleModelImpl.- Parameters:
start- the lower bound of the range of commerce discount rulesend- the upper bound of the range of commerce discount rules (not inclusive)orderByComparator- the comparator to order the results by (optionallynull)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
-
setPersistence
-