-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
HHH-13103 - Allow Hibernate Types to get access to the current configuration properties #2649
Conversation
@sebersole The reason why I think it's worth to implement this feature is that we are currently configuring the Java and SQL Type Descriptors in the constructor of the With this feature, we could allow the user to provide a specific constructor which takes the
This way, we can get access to the current properties and the user can customize the custom One use case where I wanted this future is to customize the Jackson Let me know what you think. |
@vladmihalcea I guess you will have to resolve the merge conflict before this moves any forward. |
…uration properties
87c6787
to
9ad9873
Compare
@dreab8 I rebased this PR. From the upvotes this PR got, I think it's very useful and worth integrating. Do you think it could be integrated in the next release? It's a small change and shouldn't be risky at all. |
ConfigurationService configurationService = typeConfiguration.getServiceRegistry().getService( | ||
ConfigurationService.class ); | ||
Map<String, Object> configurationSettings = configurationService.getSettings(); | ||
type = bootstrapContextAwareTypeConstructor.newInstance( new TypeBootstrapContext( |
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.
Not a fan of creating a new TypeBootstrapContext
every time. I'd pass it the TypeConfiguration
and be done with it, or have TypeConfiguration
implement TypeBootstrapContext
(after making it an interface - which it ought to be anyway imo)
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.
Or better yet, have TypeFactory be the TypeBootstrapContext
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 can work on this change
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.
Thanks.
hibernate-core/src/test/java/org/hibernate/test/type/contributor/ArrayType.java
Show resolved
Hide resolved
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've left a few comments..
Applied upstream with discussed change |
https://hibernate.atlassian.net/browse/HHH-13103