Class CollectionLiteral

All Implemented Interfaces:
SQLLiteral

public class CollectionLiteral extends CollectionExpression implements SQLLiteral
An SQL expression that will test if a column of a table falls within the given Collection of values. This is used for queries where a transient Collection is passed in as a parameter.
  • Field Details

    • value

      private final Collection value
    • elementExpressions

      private List<SQLExpression> elementExpressions
      Expressions for all elements in the Collection
  • Constructor Details

    • CollectionLiteral

      public CollectionLiteral(SQLStatement stmt, JavaTypeMapping mapping, Object value, String parameterName)
      Constructor for a collection literal with a value.
      Parameters:
      stmt - SQL statement
      mapping - The mapping to the Collection
      value - The transient Collection that is the value.
      parameterName - Name of the parameter that this represents if any (as JDBC "?")
  • Method Details

    • getValue

      public Object getValue()
      Description copied from interface: SQLLiteral
      Accessor to the literal value
      Specified by:
      getValue in interface SQLLiteral
      Returns:
      the value of the literal
    • getElementExpressions

      public List<SQLExpression> getElementExpressions()
    • setNotParameter

      public void setNotParameter()
      Description copied from interface: SQLLiteral
      Method to set this literal as not being a parameter. If the literal if not currently a parameter then does nothing. Updates any underlying SQL to have the value.
      Specified by:
      setNotParameter in interface SQLLiteral
    • setStatement

      protected void setStatement()
    • invoke

      public SQLExpression invoke(String methodName, List<SQLExpression> args)
      Description copied from class: SQLExpression
      Invocation of a method on this expression.
      Overrides:
      invoke in class CollectionExpression
      Parameters:
      methodName - name of the method to invoke
      args - Args to this method (if any)
      Returns:
      the converted value