diff --git a/hibernate-core/src/main/java/org/hibernate/boot/jaxb/mapping/marshall/CollectionClassificationMarshalling.java b/hibernate-core/src/main/java/org/hibernate/boot/jaxb/mapping/marshall/CollectionClassificationMarshalling.java new file mode 100644 index 0000000000..ecf25b7c49 --- /dev/null +++ b/hibernate-core/src/main/java/org/hibernate/boot/jaxb/mapping/marshall/CollectionClassificationMarshalling.java @@ -0,0 +1,24 @@ +/* + * Hibernate, Relational Persistence for Idiomatic Java + * + * License: GNU Lesser General Public License (LGPL), version 2.1 or later. + * See the lgpl.txt file in the root directory or http://www.gnu.org/licenses/lgpl-2.1.html. + */ +package org.hibernate.boot.jaxb.mapping.marshall; + +import org.hibernate.metamodel.CollectionClassification; + +/** + * JAXB marshalling for {@link CollectionClassification} + * + * @author Steve Ebersole + */ +public class CollectionClassificationMarshalling { + public static CollectionClassification fromXml(String name) { + return CollectionClassification.interpretSetting( name.replace( '-', '_' ) ); + } + + public static String toXml(CollectionClassification classification) { + return classification.name().replace( '_', '-' ); + } +} diff --git a/hibernate-core/src/main/java/org/hibernate/boot/model/internal/JPAXMLOverriddenMetadataProvider.java b/hibernate-core/src/main/java/org/hibernate/boot/model/internal/JPAXMLOverriddenMetadataProvider.java index 816ab3517d..7903e608b2 100644 --- a/hibernate-core/src/main/java/org/hibernate/boot/model/internal/JPAXMLOverriddenMetadataProvider.java +++ b/hibernate-core/src/main/java/org/hibernate/boot/model/internal/JPAXMLOverriddenMetadataProvider.java @@ -112,7 +112,7 @@ public class JPAXMLOverriddenMetadataProvider implements MetadataProvider { } defaults.put( EntityListeners.class, entityListeners ); for ( JaxbEntityMappings entityMappings : xmlContext.getAllDocuments() ) { - List jaxbSequenceGenerators = entityMappings.getSequenceGenerator(); + List jaxbSequenceGenerators = entityMappings.getSequenceGenerators(); List sequenceGenerators = (List) defaults.get( SequenceGenerator.class ); if ( sequenceGenerators == null ) { sequenceGenerators = new ArrayList<>(); @@ -122,7 +122,7 @@ public class JPAXMLOverriddenMetadataProvider implements MetadataProvider { sequenceGenerators.add( JPAXMLOverriddenAnnotationReader.buildSequenceGeneratorAnnotation( element ) ); } - List jaxbTableGenerators = entityMappings.getTableGenerator(); + List jaxbTableGenerators = entityMappings.getTableGenerators(); List tableGenerators = (List) defaults.get( TableGenerator.class ); if ( tableGenerators == null ) { tableGenerators = new ArrayList<>(); diff --git a/hibernate-core/src/main/java/org/hibernate/internal/util/StringHelper.java b/hibernate-core/src/main/java/org/hibernate/internal/util/StringHelper.java index 18d672fa32..a3b39499b0 100644 --- a/hibernate-core/src/main/java/org/hibernate/internal/util/StringHelper.java +++ b/hibernate-core/src/main/java/org/hibernate/internal/util/StringHelper.java @@ -584,6 +584,25 @@ public final class StringHelper { return isEmpty( prefix ) ? name : prefix + '.' + name; } + /** + * Qualifies {@code name} with {@code prefix} separated by a '.' if
    + *
  • {@code name} is not already qualified
  • + *
  • {@code prefix} is not null
  • + *
+ * + * @apiNote Similar to {@link #qualifyConditionally}, except that here we explicitly + * check whether {@code name} is already qualified. + */ + public static String qualifyConditionallyIfNot(String prefix, String name) { + if ( name == null ) { + throw new NullPointerException( "name was null attempting to build qualified name" ); + } + if ( name.indexOf( '.' ) > 0 || isEmpty( prefix ) ) { + return name; + } + return prefix + '.' + name; + } + public static String[] qualify(String prefix, String[] names) { if ( prefix == null ) { return names; diff --git a/hibernate-core/src/main/resources/org/hibernate/xsd/mapping/mapping-3.1.0.xsd b/hibernate-core/src/main/resources/org/hibernate/xsd/mapping/mapping-3.1.0.xsd index 2613a73b4b..6af69908c9 100644 --- a/hibernate-core/src/main/resources/org/hibernate/xsd/mapping/mapping-3.1.0.xsd +++ b/hibernate-core/src/main/resources/org/hibernate/xsd/mapping/mapping-3.1.0.xsd @@ -87,10 +87,15 @@ - - - - + + + + + + + + + @@ -154,6 +159,110 @@ + + + + See @JavaTypeRegistration + + + + + + + + + + See @JdbcTypeRegistration + + + + + + + + + + See @TypeRegistration + + + + + + + + + + See @CompositeTypeRegistration + + + + + + + + + + See @CollectionTypeRegistration + + + + + + + + + + + + + Configuration parameter user-types + + + + + + + + + + See `@org.hibernate.metamodel.CollectionClassification` + + + + + + + + + + + + + + + + + + + + See @ConverterRegistration + + + + + + + + + + + See @EmbeddableInstantiatorRegistration + + + + + + @@ -282,10 +391,10 @@ - - - - + + + + @@ -318,7 +427,7 @@ - + @@ -353,7 +462,7 @@ - + @@ -2122,7 +2231,7 @@ - + @@ -2161,7 +2270,7 @@ - + @@ -2481,9 +2590,9 @@ - - - + + + @@ -2494,7 +2603,7 @@ - + @@ -2705,4 +2814,5 @@ - \ No newline at end of file + + diff --git a/hibernate-core/src/main/xjb/mapping-bindings.xjb b/hibernate-core/src/main/xjb/mapping-bindings.xjb index e77f75253e..569167aadd 100644 --- a/hibernate-core/src/main/xjb/mapping-bindings.xjb +++ b/hibernate-core/src/main/xjb/mapping-bindings.xjb @@ -29,6 +29,12 @@ + + + + + + @@ -59,6 +65,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -384,6 +417,12 @@ printMethod="org.hibernate.boot.jaxb.mapping.marshall.ConstraintModeMarshalling.toXml" /> + + + + @@ -392,4 +431,4 @@ - \ No newline at end of file +