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: Inheritance and outer join revisited
PostPosted: Mon Jan 03, 2011 2:09 pm 
Pro
Pro

Joined: Wed Nov 05, 2003 7:22 pm
Posts: 211
I know there has been a lot of discussion about why Hibernate needs to outer join all tables in a joined subclass inheritance hierarchy if you query the base class.

However, Hibernate also outer join queries the parent table if you retrieve the actual Object.

E.g.
public class Animal

public class Cat extends Animal

select max(id) from Cat
results in
select max(cat0_.id) as col_0_0_ from Animal animal0_ left outer join Cat cat0_ on animal0_.id=cat0_.id where animal0_.DTYPE='CAT';

Now it makes sense that the two tables are joined. What doesn't make sense is that it is a left outer join in stead of an inner join.

Marc


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.