Marko Bekhta (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
) *created* an issue
Hibernate ORM (
https://hibernate.atlassian.net/browse/HHH?atlOrigin=eyJpIjoiYjUwOTZmZDVk...
) / Bug (
https://hibernate.atlassian.net/browse/HHH-16591?atlOrigin=eyJpIjoiYjUwOT...
) HHH-16591 (
https://hibernate.atlassian.net/browse/HHH-16591?atlOrigin=eyJpIjoiYjUwOT...
) @org.hibernate.annotations.JdbcType does not override the
`hibernate.type.preferred_duration_jdbc_type` type (
https://hibernate.atlassian.net/browse/HHH-16591?atlOrigin=eyJpIjoiYjUwOT...
)
Issue Type: Bug Affects Versions: 6.2.2 Assignee: Unassigned Components: hibernate-core
Created: 11/May/2023 09:49 AM Priority: Major Reporter: Marko Bekhta (
https://hibernate.atlassian.net/secure/ViewProfile.jspa?accountId=557058%...
)
According to the docs, the config property:
PREFERRED_DURATION_JDBC_TYPE = "hibernate.type.preferred_duration_jdbc_type"
Can be overridden on a property level by using annotations:
Can be overridden locally using org.hibernate.annotations.JdbcType,
org.hibernate.annotations.JdbcTypeCode, and friends.
While specifying a particular JdbcType class works as expected:
// will result in using the `PostgreSQLIntervalSecondJdbcType`
@Column(precision = 10, scale = 6)
@org.hibernate.annotations.JdbcType(PostgreSQLIntervalSecondJdbcType.class)
private Duration durationJdbcType;
Specifying a JdbcType code - has no effect:
// still uses the JdbcType configured by the `PREFERRED_DURATION_JDBC_TYPE` property
@Column(precision = 10, scale = 6)
@JdbcTypeCode(SqlTypes.INTERVAL_SECOND)
private Duration durationJdbcTypeCode;
I will submit a test case for this one soon.
(
https://hibernate.atlassian.net/browse/HHH-16591#add-comment?atlOrigin=ey...
) Add Comment (
https://hibernate.atlassian.net/browse/HHH-16591#add-comment?atlOrigin=ey...
)
Get Jira notifications on your phone! Download the Jira Cloud app for Android (
https://play.google.com/store/apps/details?id=com.atlassian.android.jira....
) or iOS (
https://itunes.apple.com/app/apple-store/id1006972087?pt=696495&ct=Em...
) This message was sent by Atlassian Jira (v1001.0.0-SNAPSHOT#100225- sha1:84d3b45 )