Class EntityConditionList<T extends EntityCondition>

java.lang.Object
org.apache.ofbiz.entity.condition.EntityConditionList<T>
All Implemented Interfaces:
Serializable, IsEmpty, EntityCondition

public final class EntityConditionList<T extends EntityCondition> extends Object
A condition expression corresponding to an ordered collection of conditions that are joined by an operator.

The main objective it to express the conjunction or disjunction of a set of conditions which in the case of conjunction corresponds to SQL expression of the form foo=bar AND bar=baz AND ....

See Also:
  • Constructor Details

    • EntityConditionList

      public EntityConditionList(List<? extends T> conditionList, EntityJoinOperator operator)
      Constructs an entity condition list.
      Parameters:
      conditionList - the list of conditions
      operator - the operator used to join the list of conditions
  • Method Details

    • getConditionListSize

      public int getConditionListSize()
      Provides the size of the internal list of condition expressions.
      Returns:
      the size of the internal list of condition expressions
    • getConditionIterator

      public Iterator<T> getConditionIterator()
      Provides an iterator to iterate on the internal list of condition expressions.
      Returns:
      an iterator iterating on the internal list of condition expressions
    • accept

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

      public List<? extends T> getConditions()
    • getOperator

      public EntityJoinOperator getOperator()
      Gets the infix operator used to combine every elements in the list of conditions.
      Returns:
      the infix operator used to combine every elements in the list of conditions.
    • getCondition

      public T getCondition(int index)
      Gets the condition expression stored at a particular of the internal list of conditions.
      Parameters:
      index - the index of the condition expression to find
      Returns:
      the corresponding 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
    • 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
    • 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
    • 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
    • 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