getBindingContext().getOrigin()
);
}
private void bindSimpleId(XMLId id, EntityBinding entityBinding) {
SimpleAttributeBindingState bindingState = new HbmSimpleAttributeBindingState(
entityBinding.getEntity().getJavaType().getName(),
getBindingContext(),
entityBinding.getMetaAttributeContext(),
id
);
// boolean (true here) indicates that by default column names should be guessed
HbmSimpleValueRelationalStateContainer relationalStateContainer = new HbmSimpleValueRelationalStateContainer(
getBindingContext(), true, id
);
if ( relationalStateContainer.getRelationalStates().size() > 1 ) {
throw new MappingException( "ID is expected to be a single column, but has more than 1 value" );
}
entityBinding.getEntity().getOrCreateSingularAttribute( bindingState.getAttributeName() );
entityBinding.makeSimpleIdAttributeBinding( bindingState.getAttributeName() )
.initialize( bindingState )
.initialize( relationalStateContainer.getRelationalStates().get( 0 ) );
// if ( propertyName == null || entity.getPojoRepresentation() == null ) {
// bindSimpleValue( idNode, id, false, RootClass.DEFAULT_IDENTIFIER_COLUMN_NAME, mappings );