-->
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: join in the SQL when using 'joined-subclass'
PostPosted: Mon Oct 13, 2003 1:32 pm 
Newbie

Joined: Tue Aug 26, 2003 9:52 am
Posts: 15
hi,
i have 2 related classes A and B mapped to different tables :
''<class name="A" table="T1" >
<id name="id" type="long" column="INDENT1">
<generator class="sequence">
<param name="sequence">uid_sequence</param>
</generator>
</id>
<property name="param1" type="string" column="column1"/>
<joined-subclass name="B" schema="siebesr" table="T2">
<key column="INDENT1"/>
<property name="param2" type="string" column="column2"/>
</joined-subclass>
</class>''

class B extends class A.

when i look for the object A using :
''session.createQuery("from A objet where objet.id = :id");''

hibernate generate the following SQL :
"select ...
from T1 t1 left outer join T2 t2 on t1.INDENT1=t2.INDENT1 where (t2.INDENT1=? )"

I need to parameter this join.

1) why hibernate make join between T1 and T2 eventhough i looked for just the object A?
2) is there a way to avoid this join when i don't need it; and to force the join when i need it?


Top
 Profile  
 
 Post subject: Re: join in the SQL when using 'joined-subclass'
PostPosted: Mon Oct 13, 2003 5:27 pm 
Hibernate Team
Hibernate Team

Joined: Sun Sep 14, 2003 3:54 am
Posts: 7256
Location: Paris, France
alkr wrote:
2) is there a way to avoid this join when i don't need it; and to force the join when i need it?

Never used myself, but the proxy attribute of join-subclass might do what you want.


Top
 Profile  
 
 Post subject:
PostPosted: Tue Feb 21, 2006 11:36 am 
Newbie

Joined: Tue Feb 21, 2006 7:52 am
Posts: 2
I have same problem, any body can help me ?


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.