private void bindAssociationAttribute(EntityBinding entityBinding, AttributeContainer container, AssociationAttribute associationAttribute) {
switch ( associationAttribute.getAssociationType() ) {
case MANY_TO_ONE: {
container.getOrCreateSingularAttribute( associationAttribute.getName() );
ManyToOneAttributeBinding manyToOneAttributeBinding = entityBinding.makeManyToOneAttributeBinding(
associationAttribute.getName()
);
ManyToOneAttributeBindingState bindingState = new ManyToOneBindingStateImpl( associationAttribute );
manyToOneAttributeBinding.initialize( bindingState );
ManyToOneRelationalStateImpl relationalState = new ManyToOneRelationalStateImpl();
if ( entityClass.hasOwnTable() ) {
ColumnRelationalStateImpl columnRelationsState = new ColumnRelationalStateImpl(
associationAttribute, meta
);
relationalState.addValueState( columnRelationsState );
}
manyToOneAttributeBinding.initialize( relationalState );
break;
}
default: {
// todo
}