Interface Type

All Known Implementing Classes:
AbstractBytesType, AbstractConnectMapType, AbstractConnectSchemaType, AbstractDateType, AbstractDebeziumTimestampType, AbstractDebeziumTimestampType, AbstractDebeziumTimeType, AbstractDebeziumTimeType, AbstractGeoType, AbstractTemporalType, AbstractTimestampType, AbstractTimeType, AbstractType, BitType, BitType, BitType, BooleanType, BytesType, BytesType, BytesType, BytesType, CaseInsensitiveTextType, CidrType, ConnectBooleanType, ConnectBytesType, ConnectDateType, ConnectDateType, ConnectDecimalType, ConnectFloat32Type, ConnectFloat64Type, ConnectInt16Type, ConnectInt32Type, ConnectInt64Type, ConnectInt8Type, ConnectMapToConnectStringType, ConnectStringType, ConnectTimestampType, ConnectTimestampType, ConnectTimeType, ConnectTimeType, ConnectTimeType, DateType, DateType, EnumType, EnumType, GeographyType, GeometryType, GeometryType, InetType, IntegerType, IntervalType, JsonType, JsonType, LtreeType, MacAddressType, MapToHstoreType, MapToJsonType, MediumIntType, MicroTimestampType, MicroTimestampType, MicroTimeType, MicroTimeType, MoneyType, NanoTimestampType, NanoTimestampType, NanoTimeType, NanoTimeType, NumberType, OidType, PointType, PointType, RangeType, SerialType, SetType, TimestampType, TimestampType, TimeType, TimeType, TimeWithTimezoneType, TinyIntType, UuidType, VariableScaleDecimalType, XmlType, XmlType, YearType, ZonedTimestampType, ZonedTimestampType, ZonedTimestampType, ZonedTimestampType, ZonedTimeType, ZonedTimeType, ZonedTimeType, ZonedTimeType, ZonedTimeType

public interface Type
A type represents a relational column type used for query abd parameter binding. todo: this is heavily modeled after Hibernate's type system which perhaps could be used instead? todo: is it possible to incorporate default value resolution into the type system?
Author:
Chris Cranford
  • Method Details

    • configure

      void configure(JdbcSinkConnectorConfig config, DatabaseDialect dialect)
      Allows a type to perform initialization/configuration tasks based on user configs.
      Parameters:
      config - the JDBC sink connector's configuration, should not be null
      dialect - the database dialect, should not be null
    • getRegistrationKeys

      String[] getRegistrationKeys()
      Returns the names that this type will be mapped as.

      For example, when creating a custom mapping for io.debezium.data.Bits, a type could be registered using the LOGICAL_NAME of the schema if the type is to be used when a schema name is identified; otherwise it could be registered as the raw column type when column type propagation is enabled.

    • getTypeName

      String getTypeName(DatabaseDialect dialect, org.apache.kafka.connect.data.Schema schema, boolean key)
      Return the SQL type name for this type.
      Parameters:
      dialect - dialect instance, never null
      schema - field schema, never null
      key - whether the type resolution is for a key field
      Returns:
      the resolved type to be used in DDL statements
    • getQueryBinding

      String getQueryBinding(ColumnDescriptor column, org.apache.kafka.connect.data.Schema schema, Object value)
      Return the SQL string to be used in DML statements for binding this type to SQL.
      Parameters:
      column - column descriptor in the table relational model, never null
      schema - field schema, never null
      value - value to be bound, may be null
      Returns:
      query parameter argument binding SQL fragment
    • getDefaultValueBinding

      String getDefaultValueBinding(DatabaseDialect dialect, org.apache.kafka.connect.data.Schema schema, Object value)
      Resolve the default value clause value.
      Parameters:
      dialect - dialect instance, never null
      schema - field schema, never null
      value - the default value, should not be null
      Returns:
      the formatted default value for the SQL statement as a string
    • bind

      List<ValueBindDescriptor> bind(int index, org.apache.kafka.connect.data.Schema schema, Object value)
      Binds the value to the query.
      Parameters:
      index - parameter index to bind
      schema - field schema, never null
      value - value to be bound, may be null
      Returns:
      the list of ValueBindDescriptor