Introduce PersistenceManagedTypes and AOT processing of managed entities

This commit adds PersistenceManagedTypes, an abstraction that represents
what typically happens at runtime when a persistence unit is built based
on classpath scanning.

PersistenceManagedTypesScanner extracts the logic that used to be in
DefaultPersistenceUnitManager and the latter can be configured with
a PersistenceManagedTypes instance.

This commits adds a bean registration AOT contribution that retrieves
the result of the configured instance and replaces it with the list
of managed entities. This has the result of making sure scanning, if
any, does not happen at runtime. This also could help if additional
hints for managed entities are required.

Closes gh-28287
This commit is contained in:
Stephane Nicoll
2022-08-05 09:47:51 +02:00
parent eac616a83e
commit 4fb4e54c73
13 changed files with 781 additions and 96 deletions

View File

@@ -0,0 +1,4 @@
com.example.domain.Person=jakarta.persistence.Entity
com.example.domain.Address=jakarta.persistence.Entity
com.example.domain=package-info