Closed
Description
Hantsy Bai opened SPR-11234 and commented
I used Hibernate as JPA provider and registered a LocalContainerEntityManagerFactoryBean without a persistence.xml.
But when I tried to resgiter a global audit entity listener in orm.xml file, it did not work.
I have to create a empty persistence.xml to make it work.
I think Spring should load the orm.xml by default if JPA is enabled, both with persistence.xml and without persistence.xml.
The related codes is hosted on my github.com
https://github.com/hantsy/spring-sandbox/tree/master/data-audit
Affects: 3.2.6
Issue Links:
- Add 'mappingLocations' to LocalContainerEntityManagerFactoryBean to scan any JPA mapping files (ORM.xml) in the classpath. [SPR-8440] #13086 Add 'mappingLocations' to LocalContainerEntityManagerFactoryBean to scan any JPA mapping files (ORM.xml) in the classpath.
- Unable to resolve persistence unit root URL with LocalContainerEntityManagerFactoryBean [SPR-15304] #19869 Unable to resolve persistence unit root URL with LocalContainerEntityManagerFactoryBean
- Add potentially existing orm.xml file to default persistence unit when packages to scan is used [SPR-11260] #15885 Add potentially existing orm.xml file to default persistence unit when packages to scan is used
- DefaultPersistenceUnitManager.determineDefaultPersistenceUnitRootUrl fails when run from a shaded jar [SPR-14246] #18819 DefaultPersistenceUnitManager.determineDefaultPersistenceUnitRootUrl fails when run from a shaded jar
Referenced from: commits 4ae893e
0 votes, 5 watchers