-->
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: Outer join
PostPosted: Wed Oct 17, 2007 9:13 pm 
Newbie

Joined: Sun Sep 10, 2006 12:27 pm
Posts: 13
Hi

I have this mapping file:
Code:
<class name="UnitaImmobiliare" table="UnitaImmobiliari">
....

<set name="Soggetti" table="UnitaSoggetti" generic="true" lazy="false" outer-join="true" cascade="save-update">
.....
</set>

<set name="Conduttori" table="UnitaSoggetti" where="TipoSoggetto = 'CONDU'" generic="true" lazy="true" outer-join="true" cascade="save-update">
...
</set>
    
<set name="Proprietari" table="UnitaSoggetti" where="TipoSoggetto = 'PROPR'" generic="true" lazy="true" outer-join="true" cascade="save-update">
</set>


So i have a base class "Soggetti" and two derived classes: "Conduttori" and "Proprietari", I am using the Table per class hierarchy then i have a discriminator column. I am using a where clause to load separately the instances of the three classes.

I want load all my "Conduttori", "Proprietari" and "Soggetti" entities by a outer join, but only the first class in the mapping definition is loaded by a join, the others are loaded by a single query.
In my example "Soggetti" is loaded by a join but NOT "Conduttori" and "Proprietari, if in the mapping definition "Conduttori" was the first it would be loaded by a join but not "Proprietari" and "Soggetti"

Why?

Thanks in advance
Giorgio


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.