From 93cf72bfa16a85906eec814a9e050697791f3a71 Mon Sep 17 00:00:00 2001 From: Steve Ebersole Date: Thu, 19 Mar 2015 19:22:35 -0500 Subject: [PATCH] HHH-9490 - Migrate from dom4j to jaxb for XML processing --- .../internal/stax/LocalXmlResourceResolver.java | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/hibernate-core/src/main/java/org/hibernate/boot/jaxb/internal/stax/LocalXmlResourceResolver.java b/hibernate-core/src/main/java/org/hibernate/boot/jaxb/internal/stax/LocalXmlResourceResolver.java index 92a3bee662..d065429398 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/jaxb/internal/stax/LocalXmlResourceResolver.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/jaxb/internal/stax/LocalXmlResourceResolver.java @@ -81,7 +81,17 @@ public class LocalXmlResourceResolver implements javax.xml.stream.XMLResolver { log.debug( "Recognized legacy hibernate-mapping identifier; attempting to resolve on classpath under org/hibernate/" ); - return openUrlStream( LEGACY_HBM_DTD_MAPPING.getMappedLocalUrl() ); + return openUrlStream( HBM_DTD_MAPPING.getMappedLocalUrl() ); + } + else if ( LEGACY2_HBM_DTD_MAPPING.matches( publicID, systemID ) ) { + log.recognizedObsoleteHibernateNamespace( + LEGACY2_HBM_DTD_MAPPING.getIdentifierBase(), + HBM_DTD_MAPPING.getIdentifierBase() + ); + log.debug( + "Recognized legacy hibernate-mapping identifier; attempting to resolve on classpath under org/hibernate/" + ); + return openUrlStream( HBM_DTD_MAPPING.getMappedLocalUrl() ); } else if ( CFG_DTD_MAPPING.matches( publicID, systemID ) ) { log.debug( @@ -170,6 +180,11 @@ public class LocalXmlResourceResolver implements javax.xml.stream.XMLResolver { "org/hibernate/hibernate-mapping-3.0.dtd" ); + public static final DtdMapping LEGACY2_HBM_DTD_MAPPING = new DtdMapping( + "http://hibernate.sourceforge.net/hibernate-mapping", + "org/hibernate/hibernate-mapping-3.0.dtd" + ); + public static final DtdMapping CFG_DTD_MAPPING = new DtdMapping( "http://www.hibernate.org/dtd/hibernate-configuration", "org/hibernate/hibernate-configuration-3.0.dtd"