Class SimpleExpression

java.lang.Object
io.ebeaninternal.server.expression.SimpleExpression
All Implemented Interfaces:
Expression, SpiExpression

public final class SimpleExpression extends Object
  • Field Details

    • bindValue

      protected final Object bindValue
    • propName

      protected String propName
  • Constructor Details

    • SimpleExpression

      public SimpleExpression(String propertyName, Op type, Object value)
  • Method Details

    • getIdEqualTo

      public Object getIdEqualTo(String idName)
      Description copied from interface: SpiExpression
      Return the bind Id value if this is a "equal to" expression for the id property.
      Specified by:
      getIdEqualTo in interface SpiExpression
    • naturalKey

      public boolean naturalKey(NaturalKeyQueryData<?> data)
      Description copied from interface: SpiExpression
      Check for match to a natural key query returning false if it doesn't match.
      Specified by:
      naturalKey in interface SpiExpression
    • getPropName

      public String getPropName()
    • isOpEquals

      public boolean isOpEquals()
    • getValue

      public Object getValue()
    • addBindValues

      public void addBindValues(SpiExpressionBind request)
      Description copied from interface: SpiExpression
      Add the parameter values to be set against query. For each ? place holder there should be a corresponding value that is added to the bindList.
      Parameters:
      request - the associated request.
    • addSql

      public void addSql(SpiExpressionRequest request)
      Description copied from interface: SpiExpression
      Add some sql to the query.

      This will contain ? as a place holder for each associated bind values.

      The 'sql' added to the query can contain object property names rather than db tables and columns. This 'sql' is later parsed converting the logical property names to their full database column names.

      Parameters:
      request - the associated request.
    • queryPlanHash

      public void queryPlanHash(StringBuilder builder)
      Based on the type and propertyName.
    • queryBindKey

      public void queryBindKey(BindValuesKey key)
      Description copied from interface: SpiExpression
      Build the key for bind values of the query.
    • isSameByBind

      public boolean isSameByBind(SpiExpression other)
      Description copied from interface: SpiExpression
      Return true if the expression is the same with respect to bind values.
    • value

      protected Object value()
      Return the bind value taking into account named parameters.
    • strValue

      protected String strValue()
      Return the String bind value taking into account named parameters.
    • prefixProperty

      public void prefixProperty(String path)
      Description copied from interface: SpiExpression
      Apply property prefix when filterMany expressions included into main query.
      Specified by:
      prefixProperty in interface SpiExpression
    • simplify

      public void simplify()
      Description copied from interface: SpiExpression
      Simplify nested expressions if possible.
      Specified by:
      simplify in interface SpiExpression
    • copyForPlanKey

      public SpiExpression copyForPlanKey()
      Description copied from interface: SpiExpression
      Return a copy of the expression for use in the query plan key.
      Specified by:
      copyForPlanKey in interface SpiExpression
    • containsMany

      public void containsMany(BeanDescriptor<?> desc, ManyWhereJoins manyWhereJoin)
      Description copied from interface: SpiExpression
      Process "Many" properties populating ManyWhereJoins.

      Predicates on Many properties require an extra independent join clause.

      Specified by:
      containsMany in interface SpiExpression
    • propertyContainsMany

      protected void propertyContainsMany(String propertyName, BeanDescriptor<?> desc, ManyWhereJoins manyWhereJoin)
      Check the logical property path for containing a 'many' property.
    • prepareExpression

      public void prepareExpression(BeanQueryRequest<?> request)
      Description copied from interface: SpiExpression
      Prepare the expression. For example, compile sub-query expressions etc.
      Specified by:
      prepareExpression in interface SpiExpression
    • validate

      public void validate(SpiExpressionValidation validation)
      Description copied from interface: SpiExpression
      Validate all the properties/paths associated with this expression.
      Specified by:
      validate in interface SpiExpression
    • getElProp

      protected final ElPropertyValue getElProp(SpiExpressionBind request)