Class PrimitiveColumnExpression<T>

java.lang.Object
org.fastnate.generator.statements.PrimitiveColumnExpression<T>
Type Parameters:
T - the type of the primitive value
All Implemented Interfaces:
ColumnExpression

public class PrimitiveColumnExpression<T> extends Object implements ColumnExpression
A ColumnExpression which contains a primitive value.
Author:
Tobias Liefke
  • Field Details

    • NULL

      public static final PrimitiveColumnExpression<Object> NULL
      Represents an expression of a null value.
    • value

      private final T value
      The original primitive value.
    • databaseValue

      private final T databaseValue
      The primitive database value (which may be used in an prepared statement).
    • converter

      private final Function<T,String> converter
      Converts the primitive value to an SQL string.
  • Constructor Details

    • PrimitiveColumnExpression

      public PrimitiveColumnExpression(T value, Function<T,String> converter)
      Creates a new instance of an expression where the original value is the database value.
      Parameters:
      value - the primitive value
      converter - converts the primitive value to an SQL string
    • PrimitiveColumnExpression

      public PrimitiveColumnExpression(T value, T databaseValue, Function<T,String> converter)
      Creates a new PrimitiveColumnExpression instance.
      Parameters:
      value - The original primitive value.
      databaseValue - The primitive database value (which may be used in an prepared statement).
      converter - Converts the primitive value to an SQL string.
  • Method Details