-
Notifications
You must be signed in to change notification settings - Fork 38.3k
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
Allow to provide a pre-computed scan PersistenceUnitManager #28287
Comments
I've tried to extract a strategy interface in snicoll@60f7697. I don't have an alternative implementation for the AOT use case but it could be as simple as getting the entities and the mapped resources and provide that back. It is a bit too magic though as the scope of what the initializer is not clearly specified. I have a feeling that the contract should be changed to produce something else. Maybe an intermediate object that contains the entities and mapped resources? |
brainstorming with @jhoeller, we're more aiming towards replacing the |
So the current plan is to allow Also, Spring Data can then get the same bean as well, and get the same information to generate their metamodel. |
In the end we extracted the logic of scanning in a dedicated type, |
DefaultPersistenceUnitManager
is quite classpath-scanning centric. With AOT, we'd like to invoke the scanning of the classpath at build-time and generate a representation of the entities that should be contributed in thePersistenceUnit
.We have a similar problem in Spring Boot with other data stores that is being investigated in spring-projects/spring-boot#30523. The solution there is to have some sort of contract where one implementation is the scanning logic, and another that provides values straight away. I don't know if that would apply here.
The purpose of this issue is to investigate how we could swap this logic when AOT runs so that it uses an hard-coded list, while providing the list to 3rd parties that might need it at build time for further processing
The text was updated successfully, but these errors were encountered: