HHH-8821 Scanning for META-INF/orm.xml does not work on Windows in jpa

mode
This commit is contained in:
Brett Meyer 2014-01-09 13:50:33 -05:00
parent bd0892a87d
commit e3040599f1
1 changed files with 3 additions and 2 deletions

View File

@ -59,12 +59,13 @@ public class NonClassFileArchiveEntryHandler implements ArchiveEntryHandler {
@SuppressWarnings("SimplifiableIfStatement")
private boolean acceptAsMappingFile(ArchiveEntry entry, ArchiveContext context) {
if ( entry.getName().endsWith( "hbm.xml" ) ) {
if ( entry.getNameWithinArchive().endsWith( "hbm.xml" ) ) {
return scanOptions.canDetectHibernateMappingFiles();
}
// todo : should really do this case-insensitively
if ( entry.getName().endsWith( "META-INF/orm.xml" ) ) {
// use getNameWithinArchive, not getName -- ensure paths are normalized (Windows, etc.)
if ( entry.getNameWithinArchive().endsWith( "META-INF/orm.xml" ) ) {
if ( context.getPersistenceUnitDescriptor().getMappingFileNames().contains( "META-INF/orm.xml" ) ) {
// if the user explicitly listed META-INF/orm.xml, only except the root one
//