-
Notifications
You must be signed in to change notification settings - Fork 38.8k
Description
Stéphane Nicoll opened SPR-7055 and commented
Since 3.0.1, DefaultPersistenceUnitManager
does not return a MutablePersistenceUnitInfo
but the standard PersistenceUnitInfo
.
We have an extension of this class that allows to re conciliate multiple persistence.xml in a single one on the fly. Here's the idea. Assume that we have defined an empty persistence unit called "pu" and that is used by our entity manager. Our extensions of the PersistenceUnitManager scans all persistence.xml and if it matches a certain condition (here if the unit name starts with 'pu') then it is re conciliated with our bootstrap persistence unit.
To do so, we use the getPersistenceUnitInfo(String name) of the class. Up to 3.0, it was returning MutablePersistenceUnitInfo
. Is there any way to have a protected method that returns the mutable class?
Btw, this is similar to what is described in #7287 except that JPA does not allow two different persistence.xml with the same persistence unit name (Weblogic namely checks that when deploying an app).
What do you think of our approach? I think I can workaround by casting but then:
- My code is no longer working with Spring 2.5.7
- Casting isn't ideal
Thanks
Affects: 3.0.1