HHH-7049 - Add tests of org.hibernate.metamodel.internal.source stuff

This commit is contained in:
Steve Ebersole 2012-02-12 18:39:07 -06:00
parent 01eec1fbd2
commit 6803e63460
1 changed files with 9 additions and 7 deletions

View File

@ -120,13 +120,15 @@ public class RootEntitySourceImpl extends AbstractEntitySourceImpl implements Ro
public List<AttributeSource> attributeSources() {
List<AttributeSource> attributeSources = new ArrayList<AttributeSource>();
final JaxbHibernateMapping.JaxbClass.JaxbNaturalId naturalId = entityElement().getNaturalId();
processAttributes(
attributeSources,
naturalId.getPropertyOrManyToOneOrComponent(),
naturalId.isMutable()
? SingularAttributeSource.NaturalIdMutability.MUTABLE
: SingularAttributeSource.NaturalIdMutability.IMMUTABLE
);
if ( naturalId != null ) {
processAttributes(
attributeSources,
naturalId.getPropertyOrManyToOneOrComponent(),
naturalId.isMutable()
? SingularAttributeSource.NaturalIdMutability.MUTABLE
: SingularAttributeSource.NaturalIdMutability.IMMUTABLE
);
}
processAttributes( attributeSources );
return attributeSources;
}