Skip to content

Add potentially existing orm.xml file to default persistence unit when packages to scan is used [SPR-11260] #15885

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
spring-projects-issues opened this issue Dec 28, 2013 · 1 comment
Assignees
Labels
in: data Issues in data modules (jdbc, orm, oxm, tx) type: enhancement A general enhancement
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Dec 28, 2013

Oliver Drotbohm opened SPR-11260 and commented

When the packages-to-scan feature of our LocalContainerEntityManagerFactoryBean is used, the default persistence unit created will cause the persistence providers to not scan for additional mapping files anymore.

This is unfortunate as global entity listeners can only be defined in XML currently. The Spring Data JPA auditing feature relies on this way of configuration. So if you're trying to use this feature you effectively have to opt out of all the nice defaulting provided by Spring and Spring Boot as you need to run with a custom persistence.xml and orm.xml again.

As META-INF/orm.xml is a reserved file it would be great if we could scan for it and expose it in the default PersistenceUnitInfo created.


Affects: 4.0 GA

Issue Links:

Referenced from: commits spring-projects/spring-boot@d39a836

@spring-projects-issues
Copy link
Collaborator Author

Juergen Hoeller commented

As of 4.0.1, we're autodetecting a "META-INF/orm.xml" file in the classpath, using it for Spring's default persistence unit if it is not co-located with a "META-INF/persistence.xml" file (since in case of such co-location, we assume it is intended for use with that persistence.xml file only, like in standard JPA layout). This should hopefully improve a simple setup scenario such as with Boot.

Juergen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: data Issues in data modules (jdbc, orm, oxm, tx) type: enhancement A general enhancement
Projects
None yet
Development

No branches or pull requests

2 participants