Class AbstractType

java.lang.Object
io.debezium.connector.jdbc.type.AbstractType
All Implemented Interfaces:
Type
Direct Known Subclasses:
AbstractConnectSchemaType, AbstractTemporalType, BitType, BitType, BitType, BooleanType, BytesType, BytesType, BytesType, CaseInsensitiveTextType, CidrType, ConnectDecimalType, EnumType, EnumType, InetType, IntegerType, IntervalType, JsonType, JsonType, LtreeType, MacAddressType, MediumIntType, MoneyType, NumberType, OidType, PointType, 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(org.apache.kafka.connect.data.Schema schema)
      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:
      schema - field schema, never 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 void bind(org.hibernate.query.Query<?> query, 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:
      query - hibernate query, is never null
      index - parameter index to bind
      schema - field schema, never null
      value - value to be bound, may be null
    • 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)
    • toString

      public String toString()
      Overrides:
      toString in class Object