-->
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: How to use hibernate <join><any>?
PostPosted: Tue Nov 06, 2012 2:34 am 
Newbie

Joined: Wed Jan 25, 2012 10:52 pm
Posts: 1
I'm reading hibernate reference, they're two elements in Hibernate: <join><any>. After reading it, I don't know what the reference is talking about.

I don't understand when to use join/any, what kind of scenarios are they suitable for? For <join/>: when setting "fetch", when will hibernate use inner join, when will use outer join, when will use select? Which tables which columns are used? And for the example hibernate reference provided, it said: <join table="ADDRESS"> <key column="ADDRESS_ID"/> <property name="address"/> <property name="zip"/> <property name="country"/> </join>, then which column is used to join these two tables?

When setting fetch for <join>, it said: fetch (optional - defaults to join): If set to join, the default, Hibernate will use an inner join to retrieve a <join> defined by a class(My question: Would anybody please give me an example to say: which is this class?) or its superclasses((My question: Would anybody please give me an example to say: which is this class?) ) and an outer join for a <join> defined by a subclass((My question: Would anybody please give me an example to say: which is this class?) ). If set to select then Hibernate will use a sequential select for a <join> defined on a subclass((My question: Would anybody please give me an example to say: which is this class?)), which will be issued only if a row turns out to represent an instance of the subclass((My question: Would anybody please give me an example to say: which is this class?)). Inner joins will still be used to retrieve a defined by the class and its superclasses((My question: Would anybody please give me an example to say: which is this class?) ).

In other words, I want to know what are all the classes said below: fetch (optional - defaults to join): If set to join, the default, Hibernate will use an inner join to retrieve a <join> defined by a class or its superclasses and an outer join for a <join> defined by a subclass. If set to select then Hibernate will use a sequential select for a <join> defined on a subclass, which will be issued only if a row turns out to represent an instance of the subclass. Inner joins will still be used to retrieve a <join> defined by the class and its superclasses.

For <any>, what kind of scenarios is it suitable for?, would u please explain how it works? Is there anybody providing example and explaining this to me? Thanks.


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.