Janario Oliveira commented on Bug HHH-6608

I had the same problem a long time ago

As I saw when we create a relationship many-to-one and use referencedColumnName it creates a mapping property(SyntheticProperty) inside the entity that is the many-to-one.
How described in javadoc SyntheticProperty is a property which does not actually exist in the model.
The name of the property will be the full name of a class replacing dot(.) by underscore(_).
e.g.
br.com.janario.Entity.manyToOne > _br_com_janario_Entity_manyToOne
br.com.janario.Entity.component.manyToOne > _br_com_janario_Entity_component.manyToOne

The problem is when we have it inside a component BinderHelper(:140) replaces the name but the last path to access the property still with a dot and when it tries to read the property by name(PersistentClass.getRecursiveProperty) it splits by dot looking to a component that does not exists.

The solution is quite simple. just replace the last dot by underscore.
Once this property will be only used to this many-to-one

I sent a pull request 355 and put a test case called ReferencedColumnNameTest.testManyToOneInsideComponentReferencedColumn
https://github.com/hibernate/hibernate-orm/pull/355

This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators.
For more information on JIRA, see: http://www.atlassian.com/software/jira