Gavin,
Sorry to hear you feel that way. I don’t come here to "insult and blame" your product, it's just the opposite. As far as I can tell in this short space of time, it's excellent -and from many points of view-.
I didn’t find examples about composite IDs like the one I posted above. The examples of this kind are very simple and I was unable to solve the situations like the ones I described with them. As documents I’m mainly using the Hibernate 3 reference doc and your book Hibernate in Action.
Of course all this is a lack of knowledge of Hibernate, and so I’m posting this here. All the common relationships / mappings were done without problems (and working beautifully).
Here are two simplified examples that illustrate the problem. I think that just one example would solve them all.
** Many to many using a composite key **
Code:
Table A
(PK) A_ID1
(PK) A_ID2
(PK) A_ID3
< more fields>
Code:
Table B
(PK) B_ID1
(PK) B_ID2
(PK) B_ID3
(PK) B_ID4
< more fields>
Code:
Table RELATION_A_B
(FK) A_ID3
(FK) B_ID2
** Recursive (one-to-many) relationship using a composite key **Code:
Table NODE
(PK) R_ID1
(PK) R_ID2
(PK) R_ID3
(FK) NEXT_NODE_ID <---- has the R_ID3
< more fields >
[/b]