Class EntityConditionList<T extends EntityCondition>

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.
      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.
      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.
      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.
      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.
      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.
      index - the index of the condition expression to find
      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
      modelEntity - the model of the entity
      entityConditionParams - the effective parameters used to substitute '?' parameters
      datasourceInfo - the model of the data source interpreting the SQL
      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
      modelEntity - the model of the entity
      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
      delegator - the delegator used to match
      map - the entity definition to match
      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
      the frozen condition expression
    • equals

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

      public int hashCode()
      hashCode in class Object
    • toString

      public String toString()
      toString in class Object