-
Notifications
You must be signed in to change notification settings - Fork 3.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
introduce JDBCTypeDescriptor.getDefaultSqlTypeCode() #4105
Conversation
2a36190
to
190d4e5
Compare
@@ -108,7 +108,7 @@ | |||
* | |||
* @throws MappingException Generally indicates an issue accessing the passed mapping object. | |||
*/ | |||
int[] sqlTypes(Mapping mapping) throws MappingException; | |||
int[] getSqlTypeCodes(Mapping mapping) throws MappingException; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As much as I like this change, I think this is a backwards compatibility concern. Not sure if that is something we are ok with, but maybe revert the renaming here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Depends what @sebersole thinks.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I do think it would be nice to minimize changes as much as we can.
Here though, I think we should just make this change. This contract is changing already wrt read-from-jdbc , so implementors and consumers are going to have to change. If we do the whole deprecation paradigm, we are just making them make changes again later if/when we remove the deprecated form)
@@ -20,7 +20,7 @@ | |||
*/ | |||
public interface SingleColumnType<T> extends Type { | |||
|
|||
int sqlType(); | |||
int getJdbcTypeCode(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Same backwards compatibility concern here as for Type
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR looks good so far, but I am missing some changes to JdbcTypeDescriptorRegistry
. IMO the default key for registration should be the sqlTypeCode to be able to have e.g. descriptors for both GIS types and JSON types which both map to the Jdbc type code Types.OTHER
Yeah, I guess that's right. |
Well, perhaps not, actually, that's unclear. Currently the only type we have were the SQL and JDBC types differ is Now, naturally we can special-case |
Nothing says the "conflicts" have to register under the key for |
Just pushed a fix to a breakage I caused in the build. Sorry. Can you rebase this from upstream wip/6.0 and push again? |
and rename sqlType -> jdbcTypeCode in Type hierarchy for consistency See hibernate#4088
The goal of this PR is to cleanly separate usages of the JDBC type code in interactions with the JDBC API, with usages of the JDBC type code to identify a SQL column type in schema export.
This should fix a bug I introduced a while back.
Also rename
sqlType
->jdbcTypeCodes
in Type hierarchy for consistency.See #4088
cc @beikov @sebersole