Class EntityCondition
- java.lang.Object
-
- org.apache.ofbiz.entity.condition.EntityConditionBase
-
- org.apache.ofbiz.entity.condition.EntityCondition
-
- All Implemented Interfaces:
java.io.Serializable
,IsEmpty
- Direct Known Subclasses:
EntityConditionFunction
,EntityConditionListBase
,EntityDateFilterCondition
,EntityExpr
,EntityWhereString
public abstract class EntityCondition extends EntityConditionBase implements IsEmpty
Represents the conditions to be used to constrain a query.
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
- EntityFieldMap: a map of fields where the field (key) equals the value, combined with the operator specified
- See Also:
- Serialized Form
-
-
Field Summary
-
Fields inherited from class org.apache.ofbiz.entity.condition.EntityConditionBase
_emptyMap, emptyAliases, emptyList
-
-
Constructor Summary
Constructors Constructor Description EntityCondition()
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description abstract void
accept(EntityConditionVisitor visitor)
Applies a visitor to this condition.abstract void
checkCondition(ModelEntity modelEntity)
boolean
entityMatches(GenericEntity entity)
java.lang.Boolean
eval(Delegator delegator, java.util.Map<java.lang.String,? extends java.lang.Object> map)
java.lang.Boolean
eval(GenericEntity entity)
abstract EntityCondition
freeze()
static <R> EntityExpr
makeCondition(java.lang.String fieldName, R value)
static <T extends EntityCondition>
EntityConditionList<T>makeCondition(java.util.List<T> conditionList)
static <T extends EntityCondition>
EntityConditionList<T>makeCondition(java.util.List<T> conditionList, EntityJoinOperator operator)
static EntityFieldMap
makeCondition(java.util.Map<java.lang.String,? extends java.lang.Object> fieldMap)
static <L,R>
EntityFieldMapmakeCondition(java.util.Map<java.lang.String,? extends java.lang.Object> fieldMap, EntityComparisonOperator<L,R> compOp, EntityJoinOperator joinOp)
static EntityFieldMap
makeCondition(java.util.Map<java.lang.String,? extends java.lang.Object> fieldMap, EntityJoinOperator joinOp)
static <L,R,LL,RR>
EntityExprmakeCondition(L lhs, EntityComparisonOperator<LL,RR> operator, R rhs)
static <L,R>
EntityFieldMapmakeCondition(EntityComparisonOperator<L,R> compOp, EntityJoinOperator joinOp, java.lang.Object... keysValues)
static EntityExpr
makeCondition(EntityCondition lhs, EntityJoinOperator operator, EntityCondition rhs)
static EntityFieldMap
makeCondition(EntityJoinOperator joinOp, java.lang.Object... keysValues)
static <T extends EntityCondition>
EntityConditionList<T>makeCondition(EntityJoinOperator operator, T... conditionList)
static <T extends EntityCondition>
EntityConditionList<T>makeCondition(T... conditionList)
static EntityDateFilterCondition
makeConditionDate(java.lang.String fromDateName, java.lang.String thruDateName)
static EntityFieldMap
makeConditionMap(java.lang.Object... keysValues)
static EntityWhereString
makeConditionWhere(java.lang.String sqlString)
abstract java.lang.String
makeWhereString(ModelEntity modelEntity, java.util.List<EntityConditionParam> entityConditionParams, Datasource datasourceInfo)
abstract boolean
mapMatches(Delegator delegator, java.util.Map<java.lang.String,? extends java.lang.Object> map)
java.lang.String
toString()
-
Methods inherited from class org.apache.ofbiz.entity.condition.EntityConditionBase
addValue, castBoolean, equals, equals, getColName, getColName, getColName, getField, hashCode, hashCode
-
-
-
-
Method Detail
-
makeCondition
public static <L,R,LL,RR> EntityExpr makeCondition(L lhs, EntityComparisonOperator<LL,RR> operator, R rhs)
-
makeCondition
public static <R> EntityExpr makeCondition(java.lang.String fieldName, R value)
-
makeCondition
public static EntityExpr makeCondition(EntityCondition lhs, EntityJoinOperator operator, EntityCondition rhs)
-
makeCondition
@SafeVarargs public static <T extends EntityCondition> EntityConditionList<T> makeCondition(EntityJoinOperator operator, T... conditionList)
-
makeCondition
@SafeVarargs public static <T extends EntityCondition> EntityConditionList<T> makeCondition(T... conditionList)
-
makeCondition
public static <T extends EntityCondition> EntityConditionList<T> makeCondition(java.util.List<T> conditionList, EntityJoinOperator operator)
-
makeCondition
public static <T extends EntityCondition> EntityConditionList<T> makeCondition(java.util.List<T> conditionList)
-
makeCondition
public static <L,R> EntityFieldMap makeCondition(java.util.Map<java.lang.String,? extends java.lang.Object> fieldMap, EntityComparisonOperator<L,R> compOp, EntityJoinOperator joinOp)
-
makeCondition
public static EntityFieldMap makeCondition(java.util.Map<java.lang.String,? extends java.lang.Object> fieldMap, EntityJoinOperator joinOp)
-
makeCondition
public static EntityFieldMap makeCondition(java.util.Map<java.lang.String,? extends java.lang.Object> fieldMap)
-
makeCondition
public static <L,R> EntityFieldMap makeCondition(EntityComparisonOperator<L,R> compOp, EntityJoinOperator joinOp, java.lang.Object... keysValues)
-
makeCondition
public static EntityFieldMap makeCondition(EntityJoinOperator joinOp, java.lang.Object... keysValues)
-
makeConditionMap
public static EntityFieldMap makeConditionMap(java.lang.Object... keysValues)
-
makeConditionDate
public static EntityDateFilterCondition makeConditionDate(java.lang.String fromDateName, java.lang.String thruDateName)
-
makeConditionWhere
public static EntityWhereString makeConditionWhere(java.lang.String sqlString)
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
accept
public abstract void accept(EntityConditionVisitor visitor)
Applies a visitor to this condition.- Parameters:
visitor
- the visitor to be applied
-
makeWhereString
public abstract java.lang.String makeWhereString(ModelEntity modelEntity, java.util.List<EntityConditionParam> entityConditionParams, Datasource datasourceInfo)
-
checkCondition
public abstract void checkCondition(ModelEntity modelEntity) throws GenericModelException
- Throws:
GenericModelException
-
entityMatches
public boolean entityMatches(GenericEntity entity)
-
eval
public java.lang.Boolean eval(GenericEntity entity)
-
eval
public java.lang.Boolean eval(Delegator delegator, java.util.Map<java.lang.String,? extends java.lang.Object> map)
-
mapMatches
public abstract boolean mapMatches(Delegator delegator, java.util.Map<java.lang.String,? extends java.lang.Object> map)
-
freeze
public abstract EntityCondition freeze()
-
-