Class EntityExpr
java.lang.Object
org.apache.ofbiz.entity.condition.EntityExpr
- All Implemented Interfaces:
Serializable
,IsEmpty
,EntityCondition
Represents an infix condition expression.
- See Also:
-
Field Summary
Fields inherited from interface org.apache.ofbiz.entity.condition.EntityCondition
serialVersionUID
-
Constructor Summary
ConstructorDescriptionEntityExpr
(L lhs, EntityComparisonOperator<LL, RR> operator, R rhs) Constructs an infix comparison expression.EntityExpr
(EntityCondition lhs, EntityJoinOperator operator, EntityCondition rhs) Constructs an simple combination of expression. -
Method Summary
Modifier and TypeMethodDescriptionvoid
accept
(EntityConditionVisitor visitor) Applies a visitor to this condition.void
checkCondition
(ModelEntity modelEntity) Verifies that this condition expression is valid.void
checkRhsType
(ModelEntity modelEntity, Delegator delegator) Ensures that the right hand side of the condition expression is valid.boolean
freeze()
Create a Frozen condition expression corresponding to this condition expression.getLhs()
Gets the left hand side of the condition expression.<L,
R> EntityOperator<L, R> Gets the operator used to combine the two sides of the condition expression.getRhs()
Gets the right hand side of the condition expression.int
hashCode()
boolean
isEmpty()
makeWhereString
(ModelEntity modelEntity, List<EntityConditionParam> entityConditionParams, Datasource datasourceInfo) Dumps the corresponding SQL string.boolean
mapMatches
(Delegator delegator, Map<String, ? extends Object> map) Checks that this condition expression matches a particular entity.toString()
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.apache.ofbiz.entity.condition.EntityCondition
entityMatches, makeWhereString
-
Constructor Details
-
EntityExpr
Constructs an infix comparison expression.- Parameters:
lhs
- the left hand side of the expressionoperator
- the comparison operator used to compare the two sides of the expressionrhs
- the right hand side of the expression- Throws:
IllegalArgumentException
- iflhs
oroperator
arenull
, or ifrhs
is null when the operator is not an equality check.
-
EntityExpr
Constructs an simple combination of expression.- Parameters:
lhs
- the expression of the left hand sideoperator
- the operator used to join thelhs
andrhs
expressionsrhs
- the expression of the right hand side- Throws:
IllegalArgumentException
- if any parameter isnull
.
-
-
Method Details
-
getLhs
Gets the left hand side of the condition expression.- Returns:
- the left hand side of the condition expression
-
getOperator
Gets the operator used to combine the two sides of the condition expression.- Returns:
- the operator used to combine the two sides of the condition expression.
-
getRhs
Gets the right hand side of the condition expression.- Returns:
- the right hand side of the condition expression
-
isEmpty
public boolean isEmpty() -
makeWhereString
public String makeWhereString(ModelEntity modelEntity, List<EntityConditionParam> entityConditionParams, Datasource datasourceInfo) Description copied from interface:EntityCondition
Dumps the corresponding SQL string.- Specified by:
makeWhereString
in interfaceEntityCondition
- Parameters:
modelEntity
- the model of the entityentityConditionParams
- the effective parameters used to substitute '?' parametersdatasourceInfo
- the model of the data source interpreting the SQL- Returns:
- the corresponding SQL string
-
mapMatches
Description copied from interface:EntityCondition
Checks that this condition expression matches a particular entity.- Specified by:
mapMatches
in interfaceEntityCondition
- Parameters:
delegator
- the delegator used to matchmap
- the entity definition to match- Returns:
true
if this condition expression matchesmap
when usingdelegator
-
checkCondition
Description copied from interface:EntityCondition
Verifies that this condition expression is valid.- Specified by:
checkCondition
in interfaceEntityCondition
- Parameters:
modelEntity
- the model of the entity- Throws:
GenericModelException
- when this condition expression is not valid
-
freeze
Description copied from interface:EntityCondition
Create a Frozen condition expression corresponding to this condition expression.- Specified by:
freeze
in interfaceEntityCondition
- Returns:
- the frozen condition expression
-
accept
Description copied from interface:EntityCondition
Applies a visitor to this condition.- Specified by:
accept
in interfaceEntityCondition
- Parameters:
visitor
- the visitor to be applied
-
checkRhsType
Ensures that the right hand side of the condition expression is valid.- Parameters:
modelEntity
- the entity model used to check the condition expressiondelegator
- the delegator used to check the condition expression
-
equals
-
hashCode
public int hashCode() -
toString
-