-->
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.  [ 3 posts ] 
Author Message
 Post subject: Best practice of description scenario with Hibernate
PostPosted: Sat Jul 23, 2005 12:59 pm 
Regular
Regular

Joined: Wed Aug 25, 2004 7:40 pm
Posts: 65
Here is the description scenario:

A user has a set of described items. Those items are system predefinited and can be changed(add or delete) from time to from. A user can describe the items s/he wants. I can think of a few of implementations, but not sure which way I shall go. What is the best practice in Hiberate for this scenario in terms of domain objects and mapping.

Thanks for your inputs.

v.


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 28, 2005 2:01 pm 
Senior
Senior

Joined: Tue Jan 11, 2005 5:03 pm
Posts: 137
Location: Montreal, Quebec
I hope I understand you well.

You say a User (you need a table named User to keep them) can have many Items (you need a table Item).

If a items can be keep by only one User, you need a one-to-many relationship between them. A user (One) can have many (to-many) Items.

Or if a Item can be under (keeps by) many Users, then you need a many-to-many relationship (you need a UserItem table).

Regards,

Etienne.
Rate the post if it helped!


Top
 Profile  
 
 Post subject:
PostPosted: Thu Jul 28, 2005 8:08 pm 
Regular
Regular

Joined: Wed Aug 25, 2004 7:40 pm
Posts: 65
That is some sort of idea. Later, I thought that I only need to refer the items by the object names. Those item POJOs are definited in a XML file. With this implementation, I don't need a table for the items, but still need a cross reference table. Some related issues I will consider later on.

Thanks.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 3 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.