Class CalendarConverter

java.lang.Object
org.fastnate.generator.converter.AbstractDateConverter<Calendar>
org.fastnate.generator.converter.CalendarConverter
All Implemented Interfaces:
ValueConverter<Calendar>

public class CalendarConverter extends AbstractDateConverter<Calendar>
Converts a calendar property of an EntityClass to SQL.
Author:
Andreas Penski
  • Constructor Details

    • CalendarConverter

      public CalendarConverter(AttributeAccessor attribute, boolean mapKey)
      Creates a new instance of CalendarConverter.
      Parameters:
      attribute - the inspected attribute
      mapKey - indicates that the converter is used for the key of a map property
    • CalendarConverter

      public CalendarConverter(jakarta.persistence.TemporalType type)
      Creates a new instance of CalendarConverter.
      Parameters:
      type - the temporal type of the property
  • Method Details

    • getExpression

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