-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: has anyone succeeded in this composite key example?
PostPosted: Thu Jan 20, 2005 6:47 am 
Newbie

Joined: Mon Jan 17, 2005 9:05 am
Posts: 17
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


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.