Class EntityCondition

java.lang.Object
org.ofbiz.core.entity.EntityCondition
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
EntityConditionList, EntityExpr, EntityExprList, EntityFieldMap, EntityWhereString

public abstract class EntityCondition extends Object implements Serializable
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
  • 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
These can be used in various combinations using the EntityExpr object.
Since:
July 12, 2002
Version:
1.0
Author:
David E. Jones
See Also:
  • 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

      public abstract void checkCondition(ModelEntity modelEntity) throws GenericModelException
      Checks this condition against the given entity.
      Parameters:
      modelEntity - the entity being queried for (required)
      Throws:
      GenericModelException - if the condition is not met
    • getParameterCount

      public int getParameterCount(ModelEntity modelEntity, SqlEscapeHelper sqlEscapeHelper)
      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.