Package io.debezium.connector.jdbc.type
Interface Type
- All Known Implementing Classes:
AbstractConnectMapType,AbstractConnectSchemaType,AbstractTimestampType,AbstractTimeType,AbstractType,BitType,BitType,BitType,BooleanType,BytesType,BytesType,BytesType,CaseInsensitiveTextType,CidrType,ConnectBooleanType,ConnectBytesType,ConnectDateType,ConnectDecimalType,ConnectFloat32Type,ConnectFloat64Type,ConnectInt16Type,ConnectInt32Type,ConnectInt64Type,ConnectInt8Type,ConnectMapToConnectStringType,ConnectStringType,ConnectTimestampType,ConnectTimeType,DateType,EnumType,EnumType,InetType,IntegerType,IntervalType,JsonType,JsonType,LtreeType,MacAddressType,MapToHstoreType,MapToJsonType,MediumIntType,MicroTimestampType,MicroTimeType,MoneyType,NanoTimestampType,NanoTimeType,NumberType,OidType,PointType,RangeType,SerialType,SetType,TimestampType,TimeType,TimeWithTimezoneType,TinyIntType,UuidType,VariableScaleDecimalType,XmlType,XmlType,YearType,ZonedTimestampType,ZonedTimestampWithoutTimezoneType,ZonedTimestampWithoutTimezoneType,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 Summary
Modifier and TypeMethodDescriptionvoidbind(org.hibernate.query.Query<?> query, int index, org.apache.kafka.connect.data.Schema schema, Object value) Binds the value to the query.getDefaultValueBinding(DatabaseDialect dialect, org.apache.kafka.connect.data.Schema schema, Object value) Resolve the default value clause value.getQueryBinding(org.apache.kafka.connect.data.Schema schema) Return the SQL string to be used in DML statements for binding this type to SQL.String[]Returns the names that this type will be mapped as.getTypeName(DatabaseDialect dialect, org.apache.kafka.connect.data.Schema schema, boolean key) Return the SQL type name for this type.
-
Method Details
-
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 theLOGICAL_NAMEof 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, nevernullschema- field schema, nevernullkey- whether the type resolution is for a key field- Returns:
- the resolved type to be used in DDL statements
-
getQueryBinding
Return the SQL string to be used in DML statements for binding this type to SQL.- Parameters:
schema- field schema, nevernull- 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, nevernullschema- field schema, nevernullvalue- the default value, should not benull- Returns:
- the formatted default value for the SQL statement as a string
-
bind
void bind(org.hibernate.query.Query<?> query, int index, org.apache.kafka.connect.data.Schema schema, Object value) Binds the value to the query.- Parameters:
query- hibernate query, is nevernullindex- parameter index to bindschema- field schema, nevernullvalue- value to be bound, may benull
-