Allow org.hibernate.type.Type to customize itself with the SQL type #3810
Replies: 1 comment
-
We decided to move the information into a dedicated type |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Right now,
org.hibernate.type.Type
does not know what the SQL type is that it refers to, which is usually fine. To support JDBC array and struct types it is necessary to somehow allow the type create a variant of itself based on the SQL type. This is due to the fact thatConnection.createArrayOf
andConnection.createStruct
need the SQL type name.My suggestion is to add a method to the contracts
BasicType
and maybe also a similar one toCompositeType
:An array type or struct type could then use this sql type name to do what it needs to with the connection for reading/writing arrays/structs.
The sql type name would come from the columnDefinition as defined by the user, or if that is omitted, it would use the default type name as provided by the Dialect for the type code and size.
Beta Was this translation helpful? Give feedback.
All reactions