Package org.ofbiz.core.entity
Class EntityCondition
java.lang.Object
org.ofbiz.core.entity.EntityCondition
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
EntityConditionList,EntityExpr,EntityExprList,EntityFieldMap,EntityWhereString
Represents the conditions to be used to constrain a query
An EntityCondition can represent various type of constraints, including:
An EntityCondition can represent various type of constraints, including:
- EntityConditionList: a list of EntityConditions, combined with the operator specified
- EntityExpr: for simple expressions or expressions that combine EntityConditions
- EntityExprList: a list of EntityExprs, combined with the operator specified
- EntityFieldMap: a map of fields where the field (key) equals the value, combined with the operator specified
- Since:
- July 12, 2002
- Version:
- 1.0
- Author:
- David E. Jones
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract voidcheckCondition(ModelEntity modelEntity) Checks this condition against the given entity.intgetParameterCount(ModelEntity modelEntity, SqlEscapeHelper sqlEscapeHelper) Returns the number of SQL parameters that would be generated for this condition.abstract StringmakeWhereString(ModelEntity modelEntity, List<? super EntityConditionParam> entityConditionParams, SqlEscapeHelper sqlEscapeHelper) Creates a string for use in a WHERE clause, based on this condition.
-
Constructor Details
-
EntityCondition
public EntityCondition()
-
-
Method Details
-
makeWhereString
public abstract String makeWhereString(ModelEntity modelEntity, List<? super EntityConditionParam> entityConditionParams, SqlEscapeHelper sqlEscapeHelper) Creates a string for use in a WHERE clause, based on this condition.- Parameters:
modelEntity- the entity being queried for (required)entityConditionParams- a non-null list to which this method will add any required bind values- Returns:
- a non-null string
-
checkCondition
Checks this condition against the given entity.- Parameters:
modelEntity- the entity being queried for (required)- Throws:
GenericModelException- if the condition is not met
-
getParameterCount
Returns the number of SQL parameters that would be generated for this condition.- Parameters:
modelEntity- the entity being queried for (required)- Returns:
- the number of SQL parameters.
-