I am reading hibernate docs and searching in this forum for quite a few days on this question. A lot of people got the same problem as me, but no answer is given out. I wonder if anyone ever figure this out? Could your post your code out here so that we can reference?
A (
ID NUMBER(19), Name varchar2(255) , primary key (ID) )
B ( ID NUMBER(19), VERSION NUMBER(10), primary key (ID, VERSION) )
Class A, Class B, composite key class BKey, mapping files, codes after session open and session close.
Here is also one-to-many relationship. I wonder if possible to call session.save(parent) only , so that hibernate could save parent and child into database with a single call of session.save(parent).
another question is: How to initilize composite key class before I know the parent object 's primary key? before calling session.save(parent), parent's primray key is null, right? quite confused
|