Class EntityComparisonOperator<L,R>

java.lang.Object
org.apache.ofbiz.entity.condition.EntityOperator<L,R>
org.apache.ofbiz.entity.condition.EntityComparisonOperator<L,R>
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
EntityOperator.CollectionEntityComparisonOperator, EntityOperator.ComparableEntityComparisonOperator

public abstract class EntityComparisonOperator<L,R> extends EntityOperator<L,R>
Base class for comparisons.
See Also:
  • Constructor Details

    • EntityComparisonOperator

      public EntityComparisonOperator(int id, String code)
  • Method Details

    • makeOroPattern

      public static org.apache.oro.text.regex.Pattern makeOroPattern(String sqlLike)
    • validateSql

      public void validateSql(ModelEntity entity, L lhs, R rhs) throws GenericModelException
      Specified by:
      validateSql in class EntityOperator<L,R>
      Throws:
      GenericModelException
    • addSqlValue

      public void addSqlValue(StringBuilder sql, ModelEntity entity, List<EntityConditionParam> entityConditionParams, boolean compat, L lhs, R rhs, Datasource datasourceInfo)
      Specified by:
      addSqlValue in class EntityOperator<L,R>
    • isEmpty

      public boolean isEmpty(L lhs, R rhs)
      Specified by:
      isEmpty in class EntityOperator<L,R>
    • makeRHSWhereString

      protected void makeRHSWhereString(ModelEntity entity, List<EntityConditionParam> entityConditionParams, StringBuilder sql, ModelField field, R rhs, Datasource datasourceInfo)
      Make rhs where string.
      Parameters:
      entity - the entity
      entityConditionParams - the entity condition params
      sql - the sql
      field - the field
      rhs - the rhs
      datasourceInfo - the datasource info
    • makeRHSWhereStringValue

      protected void makeRHSWhereStringValue(ModelEntity entity, List<EntityConditionParam> entityConditionParams, StringBuilder sql, ModelField field, R rhs, Datasource datasourceInfo)
      Make rhs where string value.
      Parameters:
      entity - the entity
      entityConditionParams - the entity condition params
      sql - the sql
      field - the field
      rhs - the rhs
      datasourceInfo - the datasource info
    • compare

      public abstract boolean compare(L lhs, R rhs)
    • eval

      public Boolean eval(Delegator delegator, Map<String,? extends Object> map, L lhs, R rhs)
      Eval boolean.
      Parameters:
      delegator - the delegator
      map - the map
      lhs - the lhs
      rhs - the rhs
      Returns:
      the boolean
    • mapMatches

      public boolean mapMatches(Delegator delegator, Map<String,? extends Object> map, L lhs, R rhs)
      Specified by:
      mapMatches in class EntityOperator<L,R>
    • freeze

      public EntityCondition freeze(L lhs, R rhs)
      Specified by:
      freeze in class EntityOperator<L,R>
    • freeze

      protected Object freeze(Object item)
      Freeze object.
      Parameters:
      item - the item
      Returns:
      the object
    • compareEqual

      public static final <T> boolean compareEqual(Comparable<T> lhs, T rhs)
    • compareNotEqual

      public static final <T> boolean compareNotEqual(Comparable<T> lhs, T rhs)
    • compareGreaterThan

      public static final <T> boolean compareGreaterThan(Comparable<T> lhs, T rhs)
    • compareGreaterThanEqualTo

      public static final <T> boolean compareGreaterThanEqualTo(Comparable<T> lhs, T rhs)
    • compareLessThan

      public static final <T> boolean compareLessThan(Comparable<T> lhs, T rhs)
    • compareLessThanEqualTo

      public static final <T> boolean compareLessThanEqualTo(Comparable<T> lhs, T rhs)
    • compareIn

      public static final <L, R extends L> boolean compareIn(L lhs, R rhs)
    • compareLike

      public static final <L, R> boolean compareLike(L lhs, R rhs)