I'd like to map a one to many collection to a subclass but the key of the collection is an attribute of the parent class.
Currently i'm mapping AbstractFoo Foo and Bar class like this :
<class name="AbstractFoo" abstract="true" table="abstractFoo">
<id name="_id" column="foo_pk">
<generator class="native" />
</id>
<many-to-one name="_bar" column="bar_fk">
</many-to-one>
<joined-subclass name="Foo" table="foo">
<key column="abstractFoo_fk" />
<property name="_type" column="type" />
</joined-subclass>
</class>
<class name="Bar" table="bar">
<map name="_foos" inverse="true">
<key column="bar_fk"/>
<map-key column="type">
<one-to-many class="Foo" />
</map>
</class>
Actually when i work with that mapping Hibernate is trying to found the column bar_fk on the table foo instead of abstractFoo.
Is there any way to do such a thing ?