I have a class (call it “class C”) whose table has two foreign keys (two other classes, “class A” and “class B”‘s IDs) which make up its primary key in the DB. The problem is that neither foreign key is a property of the child class (we are avoiding backpointers, where used-by classes know who uses them).
I can map something like <id column="CLASS_A_ID" type="long"/>, but this doesn’t help when I have two keys. Any <composite-id> has to have <key-property> or <key-many-to-one> which both require a “name”.
Any ideas on how I can succesfully map this without putting the foreign IDs in the class?
I ended up having to use backpointers and changing the design. It was a bit too ambitious.