-
Notifications
You must be signed in to change notification settings - Fork 40.8k
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
Make it easier to use the auto-configured EntityManagerFactoryBuilder with Hibernate-specific properties #15318
Comments
Thank you, @petenattress. We're going to improve the documentation in 2.1.x (#15361) and take a look at making it easier to use the auto-configured Hibernate properties in 2.2. |
Many thanks @wilkinsona, that sounds good. |
Issue #15738 will allow us to revisit and redesign |
To avoid changing this now and again later on, this seems to be blocked until we figure out #15738. |
If I understood this ask correctly, it's about moving Lines 133 to 134 in c7e29b7
a few lines up so that it's applied to the auto-configured |
This relates to #3654 - I was asked to open a new issue by @wilkinsona.
When I followed the guidance in the Spring Boot documentation on how to define two entity managers, the mappings for my original entity manager stopped working, with exceptions such as this:
As #3654 describes, this was due to the
EntityManagerFactoryBuilder
not containing the Springnaming_strategy
properties which are populated by the auto-configuration when Boot creates the entity manager itself. This took me a while to get to the bottom of because the documentation does not point this out, in fact it kind of implies that theEntityManagerFactoryBuilder
can be used to construct an entity manager in the same way the auto-configuration does.For my use case, it would be useful if the
EntityManagerFactoryBuilder
contained the same set of properties created by the auto-configuration, especially to preserve the "clever" behaviour of theddl-auto
option being set differently for integration tests against an embedded database. As is, I am required to replicate this behaviour in my configuration class - I have done this for now by wiring in the properties that I could (this isn't identical to the auto-configuration, but it's close enough for my current needs):I understand that other use cases may not find the auto-population of properties useful, and that making such a change is probably not backwards compatible. If the change is not possible, I think the documentation should be updated to clarify the behaviour and ideally demonstrate how to work around it like in my example above. Perhaps as a compromise, there could be a nicer way of wiring in the result of the call to
hibernateProperties.determineHibernateProperties
, which I think is all I need.Many thanks.
The text was updated successfully, but these errors were encountered: