-->
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.  [ 2 posts ] 
Author Message
 Post subject: Help understanding a couple of key Hibernate concepts
PostPosted: Wed Aug 10, 2005 1:54 pm 
Beginner
Beginner

Joined: Fri Jul 29, 2005 2:11 pm
Posts: 21
Hello, I'm using Hibernate 3 and already have a bunch of very simple one-class-per-table type stuff working, so I'm not 100% newbie (just 90% :-))

However, I'm having trouble grasping the difference between these three concepts -- any explaination would be helpful. Thanks in advance.

1. When do you use <join> versus a collection (e.g. <one-to-many>)?

2. What is the difference between collection of value types versus a collection of references to other entities? Specifically, from a cascading perspective.

3. Lastly, when do you use <composite-id>? I believe the answer is obvious here (i.e. db table is designed this way) but still wanted to hear people's thoughts here.

Thanks again.


Top
 Profile  
 
 Post subject:
PostPosted: Wed Aug 10, 2005 2:04 pm 
Senior
Senior

Joined: Thu May 12, 2005 11:40 pm
Posts: 125
Location: Canada
1. Apples and oranges. <join> pulls a value from another table into the mapped class. Your object model can be fine grained, where you have more classes than tables (<component>), flat, where you have as many classes as tables (regular <class> mappings, one per table), or coarse grained, where you have more tables than classes (<join>).

2. I think a collection of components has the same semantics as a collection of entities mapped with cascade="all,delete-orphan"

3. I think you pretty much answered your own question there. <composite-id> is not nice to work with, avoid it if you can.


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