if ( entityBinding == null ) {
throw new org.hibernate.MappingException(
"Attribute [" + attributeBinding.getAttribute().getName() +
"] refers to unknown entity: [" + attributeBinding.getReferencedEntityName() + "]" );
}
AttributeBinding referencedAttributeBinding =
attributeBinding.isPropertyReference() ?
entityBinding.getAttributeBinding( attributeBinding.getReferencedAttributeName() ) :
entityBinding.getEntityIdentifier().getValueBinding();
if ( referencedAttributeBinding == null ) {
// TODO: does attribute name include path w/ entity name?
throw new MappingException(
"Attribute [" + attributeBinding.getAttribute().getName() +
"] refers to unknown attribute: [" + attributeBinding.getReferencedEntityName() + "]"
);
}
attributeBinding.resolveReference( referencedAttributeBinding );
referencedAttributeBinding.addEntityReferencingAttributeBinding( attributeBinding );
}