Class CustomValueConverter<T,C>

java.lang.Object
org.fastnate.generator.converter.CustomValueConverter<T,C>
Type Parameters:
T - the type of the attribute
C - the type of the database column
All Implemented Interfaces:
ValueConverter<T>

public class CustomValueConverter<T,C> extends Object implements ValueConverter<T>
A value converter that uses an AttributeConverter.
Author:
Tobias Liefke
  • Constructor Details

    • CustomValueConverter

      public CustomValueConverter(jakarta.persistence.AttributeConverter<T,C> customConverter, ValueConverter<C> valueConverter)
  • Method Details

    • getExpression

      public ColumnExpression getExpression(T 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<T>
      Parameters:
      value - the current value
      context - the current context (contains the database dialect).
      Returns:
      the expression (that is including surrounding ' for string literals)