From 347398aad592e265d624d2fa6ac35ba44816d080 Mon Sep 17 00:00:00 2001 From: Strong Liu Date: Mon, 16 Jul 2012 19:16:21 +0800 Subject: [PATCH] HHH-7450 fix test failure --- .../internal/source/hbm/RootEntitySourceImpl.java | 15 +++++++-------- .../org/hibernate/hibernate-mapping-4.0.xsd | 5 +++++ 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/hbm/RootEntitySourceImpl.java b/hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/hbm/RootEntitySourceImpl.java index d1ec03937a..de0ad8519c 100644 --- a/hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/hbm/RootEntitySourceImpl.java +++ b/hibernate-core/src/main/java/org/hibernate/metamodel/internal/source/hbm/RootEntitySourceImpl.java @@ -141,15 +141,14 @@ public class RootEntitySourceImpl extends AbstractEntitySourceImpl implements Ro protected List buildAttributeSources(List attributeSources) { final JaxbNaturalIdElement naturalId = entityElement().getNaturalId(); if ( naturalId != null ) { - return buildAttributeSources( - entityElement(), attributeSources, null, naturalId.isMutable() - ? SingularAttributeBinding.NaturalIdMutability.MUTABLE - : SingularAttributeBinding.NaturalIdMutability.IMMUTABLE - ); - } - else { - return super.buildAttributeSources( attributeSources ); + final SingularAttributeBinding.NaturalIdMutability naturalIdMutability = naturalId.isMutable() ? SingularAttributeBinding.NaturalIdMutability.MUTABLE : SingularAttributeBinding.NaturalIdMutability.IMMUTABLE; + processPropertyAttributes( attributeSources, naturalId.getProperty(), null, naturalIdMutability ); + processManyToOneAttributes( attributeSources, naturalId.getManyToOne(), null, naturalIdMutability ); + processComponentAttributes( attributeSources, naturalId.getComponent(), null, naturalIdMutability ); + processDynamicComponentAttributes( attributeSources, naturalId.getDynamicComponent(), null, naturalIdMutability ); + processAnyAttributes( attributeSources, naturalId.getAny(), null, naturalIdMutability ); } + return super.buildAttributeSources( attributeSources ); } @Override diff --git a/hibernate-core/src/main/resources/org/hibernate/hibernate-mapping-4.0.xsd b/hibernate-core/src/main/resources/org/hibernate/hibernate-mapping-4.0.xsd index 367301a70c..1d1805075c 100644 --- a/hibernate-core/src/main/resources/org/hibernate/hibernate-mapping-4.0.xsd +++ b/hibernate-core/src/main/resources/org/hibernate/hibernate-mapping-4.0.xsd @@ -321,6 +321,11 @@ arbitrary number of queries, and import declarations of arbitrary classes. + + + + +