public class CommerceDiscountRuleUtil
extends java.lang.Object
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
CommerceDiscountRulePersistence
Constructor and Description |
---|
CommerceDiscountRuleUtil() |
Modifier and Type | Method and Description |
---|---|
static void |
cacheResult(CommerceDiscountRule commerceDiscountRule)
Caches the commerce discount rule in the entity cache if it is enabled.
|
static void |
cacheResult(java.util.List<CommerceDiscountRule> commerceDiscountRules)
Caches the commerce discount rules in the entity cache if it is enabled.
|
static void |
clearCache() |
static void |
clearCache(CommerceDiscountRule commerceDiscountRule) |
static int |
countAll()
Returns the number of commerce discount rules.
|
static int |
countByCommerceDiscountId(long commerceDiscountId)
Returns the number of commerce discount rules where commerceDiscountId = ?.
|
static long |
countWithDynamicQuery(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) |
static CommerceDiscountRule |
create(long commerceDiscountRuleId)
Creates a new commerce discount rule with the primary key.
|
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 = ?.
|
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 = ?.
|
static CommerceDiscountRule |
fetchByPrimaryKey(long commerceDiscountRuleId)
Returns the commerce discount rule with the primary key or returns
null if it could not be found. |
static java.util.Map<java.io.Serializable,CommerceDiscountRule> |
fetchByPrimaryKeys(java.util.Set<java.io.Serializable> primaryKeys) |
static java.util.List<CommerceDiscountRule> |
findAll()
Returns all the commerce discount rules.
|
static java.util.List<CommerceDiscountRule> |
findAll(int start,
int end)
Returns a range of all the commerce discount rules.
|
static java.util.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 java.util.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 CommerceDiscountRule |
findByCommerceDiscountId_First(long commerceDiscountId,
com.liferay.portal.kernel.util.OrderByComparator<CommerceDiscountRule> orderByComparator)
Returns the first commerce discount rule in the ordered set where commerceDiscountId = ?.
|
static CommerceDiscountRule |
findByCommerceDiscountId_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 java.util.List<CommerceDiscountRule> |
findByCommerceDiscountId(long commerceDiscountId)
Returns all the commerce discount rules where commerceDiscountId = ?.
|
static java.util.List<CommerceDiscountRule> |
findByCommerceDiscountId(long commerceDiscountId,
int start,
int end)
Returns a range of all the commerce discount rules where commerceDiscountId = ?.
|
static java.util.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 java.util.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 CommerceDiscountRule |
findByPrimaryKey(long commerceDiscountRuleId)
Returns the commerce discount rule with the primary key or throws a
NoSuchDiscountRuleException if it could not be found. |
static java.util.List<CommerceDiscountRule> |
findWithDynamicQuery(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery) |
static java.util.List<CommerceDiscountRule> |
findWithDynamicQuery(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery,
int start,
int end) |
static java.util.List<CommerceDiscountRule> |
findWithDynamicQuery(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery,
int start,
int end,
com.liferay.portal.kernel.util.OrderByComparator<CommerceDiscountRule> orderByComparator) |
static CommerceDiscountRulePersistence |
getPersistence() |
static CommerceDiscountRule |
remove(long commerceDiscountRuleId)
Removes the commerce discount rule with the primary key from the database.
|
static void |
removeAll()
Removes all the commerce discount rules from the database.
|
static void |
removeByCommerceDiscountId(long commerceDiscountId)
Removes all the commerce discount rules where commerceDiscountId = ? from the database.
|
static CommerceDiscountRule |
update(CommerceDiscountRule commerceDiscountRule) |
static CommerceDiscountRule |
update(CommerceDiscountRule commerceDiscountRule,
com.liferay.portal.kernel.service.ServiceContext serviceContext) |
static CommerceDiscountRule |
updateImpl(CommerceDiscountRule commerceDiscountRule) |
public static void clearCache()
BasePersistence.clearCache()
public static void clearCache(CommerceDiscountRule commerceDiscountRule)
BasePersistence.clearCache(com.liferay.portal.kernel.model.BaseModel)
public static long countWithDynamicQuery(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
BasePersistence.countWithDynamicQuery(DynamicQuery)
public static java.util.Map<java.io.Serializable,CommerceDiscountRule> fetchByPrimaryKeys(java.util.Set<java.io.Serializable> primaryKeys)
BasePersistence.fetchByPrimaryKeys(Set)
public static java.util.List<CommerceDiscountRule> findWithDynamicQuery(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery)
BasePersistence.findWithDynamicQuery(DynamicQuery)
public static java.util.List<CommerceDiscountRule> findWithDynamicQuery(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, int end)
BasePersistence.findWithDynamicQuery(DynamicQuery, int, int)
public static java.util.List<CommerceDiscountRule> findWithDynamicQuery(com.liferay.portal.kernel.dao.orm.DynamicQuery dynamicQuery, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<CommerceDiscountRule> orderByComparator)
BasePersistence.findWithDynamicQuery(DynamicQuery, int, int, OrderByComparator)
public static CommerceDiscountRule update(CommerceDiscountRule commerceDiscountRule)
BasePersistence.update(com.liferay.portal.kernel.model.BaseModel)
public static CommerceDiscountRule update(CommerceDiscountRule commerceDiscountRule, com.liferay.portal.kernel.service.ServiceContext serviceContext)
BasePersistence.update(com.liferay.portal.kernel.model.BaseModel, ServiceContext)
public static java.util.List<CommerceDiscountRule> findByCommerceDiscountId(long commerceDiscountId)
commerceDiscountId
- the commerce discount IDpublic static java.util.List<CommerceDiscountRule> findByCommerceDiscountId(long commerceDiscountId, int start, int end)
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
.
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)public static java.util.List<CommerceDiscountRule> findByCommerceDiscountId(long commerceDiscountId, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<CommerceDiscountRule> orderByComparator)
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
.
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 (optionally null
)public static java.util.List<CommerceDiscountRule> findByCommerceDiscountId(long commerceDiscountId, int start, int end, com.liferay.portal.kernel.util.OrderByComparator<CommerceDiscountRule> orderByComparator, boolean useFinderCache)
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
.
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 (optionally null
)useFinderCache
- whether to use the finder cachepublic static CommerceDiscountRule findByCommerceDiscountId_First(long commerceDiscountId, com.liferay.portal.kernel.util.OrderByComparator<CommerceDiscountRule> orderByComparator) throws NoSuchDiscountRuleException
commerceDiscountId
- the commerce discount IDorderByComparator
- the comparator to order the set by (optionally null
)NoSuchDiscountRuleException
- if a matching commerce discount rule could not be foundpublic static CommerceDiscountRule fetchByCommerceDiscountId_First(long commerceDiscountId, com.liferay.portal.kernel.util.OrderByComparator<CommerceDiscountRule> orderByComparator)
commerceDiscountId
- the commerce discount IDorderByComparator
- the comparator to order the set by (optionally null
)null
if a matching commerce discount rule could not be foundpublic static CommerceDiscountRule findByCommerceDiscountId_Last(long commerceDiscountId, com.liferay.portal.kernel.util.OrderByComparator<CommerceDiscountRule> orderByComparator) throws NoSuchDiscountRuleException
commerceDiscountId
- the commerce discount IDorderByComparator
- the comparator to order the set by (optionally null
)NoSuchDiscountRuleException
- if a matching commerce discount rule could not be foundpublic static CommerceDiscountRule fetchByCommerceDiscountId_Last(long commerceDiscountId, com.liferay.portal.kernel.util.OrderByComparator<CommerceDiscountRule> orderByComparator)
commerceDiscountId
- the commerce discount IDorderByComparator
- the comparator to order the set by (optionally null
)null
if a matching commerce discount rule could not be foundpublic static CommerceDiscountRule[] findByCommerceDiscountId_PrevAndNext(long commerceDiscountRuleId, long commerceDiscountId, com.liferay.portal.kernel.util.OrderByComparator<CommerceDiscountRule> orderByComparator) throws NoSuchDiscountRuleException
commerceDiscountRuleId
- the primary key of the current commerce discount rulecommerceDiscountId
- the commerce discount IDorderByComparator
- the comparator to order the set by (optionally null
)NoSuchDiscountRuleException
- if a commerce discount rule with the primary key could not be foundpublic static void removeByCommerceDiscountId(long commerceDiscountId)
commerceDiscountId
- the commerce discount IDpublic static int countByCommerceDiscountId(long commerceDiscountId)
commerceDiscountId
- the commerce discount IDpublic static void cacheResult(CommerceDiscountRule commerceDiscountRule)
commerceDiscountRule
- the commerce discount rulepublic static void cacheResult(java.util.List<CommerceDiscountRule> commerceDiscountRules)
commerceDiscountRules
- the commerce discount rulespublic static CommerceDiscountRule create(long commerceDiscountRuleId)
commerceDiscountRuleId
- the primary key for the new commerce discount rulepublic static CommerceDiscountRule remove(long commerceDiscountRuleId) throws NoSuchDiscountRuleException
commerceDiscountRuleId
- the primary key of the commerce discount ruleNoSuchDiscountRuleException
- if a commerce discount rule with the primary key could not be foundpublic static CommerceDiscountRule updateImpl(CommerceDiscountRule commerceDiscountRule)
public static CommerceDiscountRule findByPrimaryKey(long commerceDiscountRuleId) throws NoSuchDiscountRuleException
NoSuchDiscountRuleException
if it could not be found.commerceDiscountRuleId
- the primary key of the commerce discount ruleNoSuchDiscountRuleException
- if a commerce discount rule with the primary key could not be foundpublic static CommerceDiscountRule fetchByPrimaryKey(long commerceDiscountRuleId)
null
if it could not be found.commerceDiscountRuleId
- the primary key of the commerce discount rulenull
if a commerce discount rule with the primary key could not be foundpublic static java.util.List<CommerceDiscountRule> findAll()
public static java.util.List<CommerceDiscountRule> findAll(int start, int end)
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
.
start
- the lower bound of the range of commerce discount rulesend
- the upper bound of the range of commerce discount rules (not inclusive)public static java.util.List<CommerceDiscountRule> findAll(int start, int end, com.liferay.portal.kernel.util.OrderByComparator<CommerceDiscountRule> orderByComparator)
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
.
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 (optionally null
)public static java.util.List<CommerceDiscountRule> findAll(int start, int end, com.liferay.portal.kernel.util.OrderByComparator<CommerceDiscountRule> orderByComparator, boolean useFinderCache)
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
.
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 (optionally null
)useFinderCache
- whether to use the finder cachepublic static void removeAll()
public static int countAll()
public static CommerceDiscountRulePersistence getPersistence()