open fun setPersistenceUnits(persistenceUnits: MutableMap<String, String>): Unit
Specify the persistence units for EntityManagerFactory lookups, as a Map from persistence unit name to persistence unit JNDI name (which needs to resolve to an EntityManagerFactory instance).
JNDI names specified here should refer to persistence-unit-ref entries in the Java EE deployment descriptor, matching the target persistence unit.
In case of no unit name specified in the annotation, the specified value for the default persistence unit will be taken (by default, the value mapped to the empty String), or simply the single persistence unit if there is only one.
This is mainly intended for use in a Java EE environment, with all lookup driven by the standard JPA annotations, and all EntityManagerFactory references obtained from JNDI. No separate EntityManagerFactory bean definitions are necessary in such a scenario.
If no corresponding "persistenceContexts"/"extendedPersistenceContexts" are specified, @PersistenceContext will be resolved to EntityManagers built on top of the EntityManagerFactory defined here. Note that those will be Spring-managed EntityManagers, which implement transaction synchronization based on Spring's facilities. If you prefer the Java EE server's own EntityManager handling, specify corresponding "persistenceContexts"/"extendedPersistenceContexts".