Class EntityExpr

java.lang.Object
org.apache.ofbiz.entity.condition.EntityExpr
All Implemented Interfaces:
Serializable, IsEmpty, EntityCondition

public final class EntityExpr extends Object implements EntityCondition
Represents an infix condition expression.
See Also:
  • Constructor Details

    • EntityExpr

      public EntityExpr(L lhs, EntityComparisonOperator<LL,RR> operator, R rhs)
      Constructs an infix comparison expression.
      Parameters:
      lhs - the left hand side of the expression
      operator - the comparison operator used to compare the two sides of the expression
      rhs - the right hand side of the expression
      Throws:
      IllegalArgumentException - if lhs or operator are null, or if rhs is null when the operator is not an equality check.
    • EntityExpr

      public EntityExpr(EntityCondition lhs, EntityJoinOperator operator, EntityCondition rhs)
      Constructs an simple combination of expression.
      Parameters:
      lhs - the expression of the left hand side
      operator - the operator used to join the lhs and rhs expressions
      rhs - the expression of the right hand side
      Throws:
      IllegalArgumentException - if any parameter is null.
  • Method Details

    • getLhs

      public Object getLhs()
      Gets the left hand side of the condition expression.
      Returns:
      the left hand side of the condition expression
    • getOperator

      public <L, R> EntityOperator<L,R> 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

      public Object getRhs()
      Gets the right hand side of the condition expression.
      Returns:
      the right hand side of the condition expression
    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface 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 interface EntityCondition
      Parameters:
      modelEntity - the model of the entity
      entityConditionParams - the effective parameters used to substitute '?' parameters
      datasourceInfo - the model of the data source interpreting the SQL
      Returns:
      the corresponding SQL string
    • mapMatches

      public boolean mapMatches(Delegator delegator, Map<String,? extends Object> map)
      Description copied from interface: EntityCondition
      Checks that this condition expression matches a particular entity.
      Specified by:
      mapMatches in interface EntityCondition
      Parameters:
      delegator - the delegator used to match
      map - the entity definition to match
      Returns:
      true if this condition expression matches map when using delegator
    • checkCondition

      public void checkCondition(ModelEntity modelEntity) throws GenericModelException
      Description copied from interface: EntityCondition
      Verifies that this condition expression is valid.
      Specified by:
      checkCondition in interface EntityCondition
      Parameters:
      modelEntity - the model of the entity
      Throws:
      GenericModelException - when this condition expression is not valid
    • freeze

      public EntityCondition freeze()
      Description copied from interface: EntityCondition
      Create a Frozen condition expression corresponding to this condition expression.
      Specified by:
      freeze in interface EntityCondition
      Returns:
      the frozen condition expression
    • accept

      public void accept(EntityConditionVisitor visitor)
      Description copied from interface: EntityCondition
      Applies a visitor to this condition.
      Specified by:
      accept in interface EntityCondition
      Parameters:
      visitor - the visitor to be applied
    • checkRhsType

      public void checkRhsType(ModelEntity modelEntity, Delegator delegator)
      Ensures that the right hand side of the condition expression is valid.
      Parameters:
      modelEntity - the entity model used to check the condition expression
      delegator - the delegator used to check the condition expression
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • toString

      public String toString()
      Overrides:
      toString in class Object