Gail Badner commented on Bug HHH-8021

I think the problem is that Hibernate assumes that all columns of a "joined" property are in the secondary table. I'm not absolutely sure, but i think this is true for hbm.xml. Using annotations, a property column can be assigned to a secondary table, so a "joined" property doesn't make sense in that context.

I think this can be fixed by:

  • adding Property.getTableIterator() (corresponding with getColumnIterator()), and PersistentClass;
  • changing PersistentClass.getJoinNumber(Property prop) to getJoinNumber(Table);
  • changing the internal bookkeeping maintained by the entity persister;
  • changing the code that generates the SQL to perform operations on the proper table(s).

I'm not sure if these changes should be made to the old mapping code at this point. I'm also not sure if Property and PersistentClass are considered public API/SPI.

We need to make sure the new metamodel will support a use case like this.

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