Skip to content

Fix LocalContainerEntityManagerFactoryBean#setPersistenceUnitName javadoc #36205

@jhoeller

Description

@jhoeller

@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 single LocalContainerEntityManagerFactoryBean, 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.

Originally posted by @mauromol in #11447

Metadata

Metadata

Assignees

Labels

in: dataIssues in data modules (jdbc, orm, oxm, tx)status: backportedAn issue that has been backported to maintenance branchestype: documentationA documentation task

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions