-
Notifications
You must be signed in to change notification settings - Fork 38.9k
Description
@jhoeller doesn't this still apply?
In the documentation at (for Spring Framework 7.0.3 at the time of writing):
https://docs.spring.io/spring-framework/reference/data-access/orm/jpa.html#orm-jpa-setup-multiple
it's defining just a singleLocalContainerEntityManagerFactoryBean, not multiple ones.
Additionally,LocalContainerEntityManagerFactoryBean#setPersistenceUnitName(String)javadoc says:Uses the specified persistence unit name as the name of the default persistence unit, if applicable.
NOTE: Only applied if no external PersistenceUnitManager specified.To my understanding, instead, this is wrong. It's the persistence unit name that this factory should create an entity manager factory for, and it perfectly applies also to the case in which you do have a persistence unit manager. Looking at the source, it seems like, in case it's not specified, the returned entity manager factory will use the persistence unit manager default persistence unit name, that doesn't mean that it's not applied if a persistence unit manager is specified.