-->
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.  [ 4 posts ] 
Author Message
 Post subject: indexed collection with id sequence
PostPosted: Tue Jul 19, 2005 12:15 pm 
Newbie

Joined: Fri Jul 15, 2005 6:35 am
Posts: 12
(...sorry for my english...)

I have a table PARENT P with
P.ID
P.DESCRIPTION

and I must map an indexed collection with a list in a table CHILD C.
C.ID
C.INDEX
C.VALUE

what is the best mapping solution for save/update the parent and the child so that the P.ID is assigned by a oracle sequence
and C.ID is assigned by P.ID (the same sequence number).
How can I write the java code without managing the sequence number
(I want let do the work to oracle and hibernate).

It is possibile to assign an automatic INDEX value taken from the list index?

Thank you very much.
Luca+


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jul 20, 2005 7:59 pm 
Beginner
Beginner

Joined: Fri May 21, 2004 12:21 pm
Posts: 22
Location: Sacramento CA, USA
This is a very basic Question. Every thing you asked is explained very well in hibernate reference document.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 21, 2005 3:06 am 
Newbie

Joined: Fri Jul 15, 2005 6:35 am
Posts: 12
I red the entire reference documentation (release 2.1 and 3.0) word by word, and there is no examples of parent/child with a indexed list automatically assigned.
I red the "hibernate in action" book and also "pro hibernate 3".
I want to automatically assign a row-index for the children entity.
:-]


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 21, 2005 5:03 am 
Beginner
Beginner

Joined: Wed May 04, 2005 5:17 am
Posts: 40
Not sure if it will work with one-many but you can map a primary key to be the same as a foreign key. See section 6.1.4.1 http://www.hibernate.org/hib_docs/v3/re ... tml_single


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

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.