Class BooleanConverter

java.lang.Object
org.fastnate.generator.converter.BooleanConverter
All Implemented Interfaces:
ValueConverter<Boolean>

public class BooleanConverter extends Object implements ValueConverter<Boolean>
Converts a boolean to a SQL expression.
Author:
Tobias Liefke
  • Constructor Details

    • BooleanConverter

      public BooleanConverter()
  • Method Details

    • getExpression

      public ColumnExpression getExpression(Boolean value, GeneratorContext context)
      Description copied from interface: ValueConverter
      Builds the expression for writing the given value into an SQL clause.
      Specified by:
      getExpression in interface ValueConverter<Boolean>
      Parameters:
      value - the current value
      context - the current context (contains the database dialect).
      Returns:
      the expression (that is including surrounding ' for string literals)
    • getExpression

      public ColumnExpression getExpression(String defaultValue, GeneratorContext context)
      Description copied from interface: ValueConverter
      Builds the expression for writing the default value into an SQL clause.
      Specified by:
      getExpression in interface ValueConverter<Boolean>
      Parameters:
      defaultValue - the default value, as given in an DefaultValue expression
      context - the current context (contains the database dialect).
      Returns:
      the expression (that is including surrounding ' for string literals)