-->
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: What is a good approach for this one-to-many case?
PostPosted: Wed Aug 17, 2005 10:33 am 
Regular
Regular

Joined: Wed Aug 25, 2004 7:40 pm
Posts: 65
After reading the document and studying examples, I haven't find a similar case example. I would lilke to know a good approach for the following case.

An object A contains a list of items. This object will be frequently updated through out the live time of the application. In each update, only the list of items is changed. The application has a fixed set of such objects. And I consider to let the application assign an ID to the object instead of generated one by the backend.

I know this can been done by the conventional Hibernate method, which is an object A with one-to-many mapping to the items that have their own IDs. I would like to know whether is another approach or not.

Thanks for your inputs in advance.

v.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 17, 2005 11:28 am 
Beginner
Beginner

Joined: Tue Jun 21, 2005 3:15 pm
Posts: 29
so object "A" never changes, just its children? If so let hibernate gen the ids for the children and use cascade prop to get children updated/inserted/deleted (what ever your need is).
Does this answer your question? Do you need more information? if so be more specific.
Thanks,
B

_________________
Don't forget to rate


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 17, 2005 11:50 am 
Regular
Regular

Joined: Wed Aug 25, 2004 7:40 pm
Posts: 65
Thanks for your response.

You're right. The attributes of the object A, which are ID and name, are never changed once it is created. To the object A, a updating operation is to have a new list of items. The DB operation for the items is a pair of deletion and insertion. And the item list has to be ordered.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 17, 2005 12:06 pm 
Beginner
Beginner

Joined: Tue Jun 21, 2005 3:15 pm
Posts: 29
so what is your question? :)

_________________
Don't forget to rate


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.