Class AbstractType

java.lang.Object
io.debezium.connector.jdbc.type.AbstractType
All Implemented Interfaces:
Type
Direct Known Subclasses:
AbstractBytesType, AbstractConnectSchemaType, AbstractGeoType, AbstractTemporalType, ArrayType, BitType, BitType, BitType, BooleanType, CaseInsensitiveTextType, CidrType, ConnectDecimalType, EnumType, EnumType, InetType, IntegerType, IntervalType, JsonType, JsonType, LtreeType, MacAddressType, MediumIntType, MoneyType, NumberType, OidType, RangeType, SerialType, SetType, TinyIntType, UuidType, VariableScaleDecimalType, XmlType, XmlType, YearType

public abstract class AbstractType extends Object implements Type
An abstract implementation of Type, which all types should extend.
Author:
Chris Cranford
  • Field Details

  • Constructor Details

    • AbstractType

      public AbstractType()
  • Method Details

    • configure

      public void configure(JdbcSinkConnectorConfig config, DatabaseDialect dialect)
      Description copied from interface: Type
      Allows a type to perform initialization/configuration tasks based on user configs.
      Specified by:
      configure in interface Type
      Parameters:
      config - the JDBC sink connector's configuration, should not be null
      dialect - the database dialect, should not be null
    • getQueryBinding

      public String getQueryBinding(ColumnDescriptor column, org.apache.kafka.connect.data.Schema schema, Object value)
      Description copied from interface: Type
      Return the SQL string to be used in DML statements for binding this type to SQL.
      Specified by:
      getQueryBinding in interface Type
      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

      public String getDefaultValueBinding(DatabaseDialect dialect, org.apache.kafka.connect.data.Schema schema, Object value)
      Description copied from interface: Type
      Resolve the default value clause value.
      Specified by:
      getDefaultValueBinding in interface Type
      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

      public List<ValueBindDescriptor> bind(int index, org.apache.kafka.connect.data.Schema schema, Object value)
      Description copied from interface: Type
      Binds the value to the query.
      Specified by:
      bind in interface Type
      Parameters:
      index - parameter index to bind
      schema - field schema, never null
      value - value to be bound, may be null
      Returns:
      the list of ValueBindDescriptor
    • getDialect

      protected DatabaseDialect getDialect()
    • getSourceColumnType

      protected Optional<String> getSourceColumnType(org.apache.kafka.connect.data.Schema schema)
    • getSourceColumnSize

      protected Optional<String> getSourceColumnSize(org.apache.kafka.connect.data.Schema schema)
    • getSourceColumnPrecision

      protected Optional<String> getSourceColumnPrecision(org.apache.kafka.connect.data.Schema schema)
    • getSchemaParameter

      protected Optional<String> getSchemaParameter(org.apache.kafka.connect.data.Schema schema, String parameterName)
    • throwUnexpectedValue

      protected void throwUnexpectedValue(Object value) throws org.apache.kafka.connect.errors.ConnectException
      Throws:
      org.apache.kafka.connect.errors.ConnectException
    • toString

      public String toString()
      Overrides:
      toString in class Object