-->
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: Problem with left join fetch
PostPosted: Thu Sep 11, 2008 3:57 pm 
Beginner
Beginner

Joined: Mon Jul 09, 2007 2:21 pm
Posts: 24
i have the following tables

Table1
ID
NAME

Table2
ID
DESCR
TABLE1_ID NULLABLE, Foreign key referencing ID of Table1



Hql: from Table1 rs left join fetch rs.table2 sgms


A null pointer exception is thrown when executing the above hql...but if i remove "fetch" from the hql statement it works fine.

Can you help me resolve this?

Table1.hbm.xml
----------
----------
<set name="Table2" inverse="true">
<key>
<column name="TABLE1_ID" precision="22" scale="0" />
</key>

<one-to-many class="com.mavent.model.Table1" />
</set>



Table2.hbm.xml

----------------
---------------
<many-to-one name="Table1" class="com.mavent.model.Table1" fetch="select">

<column name="TABLE1_ID" precision="22" scale="0" />
</many-to-one>


Top
 Profile  
 
 Post subject:
PostPosted: Fri Sep 12, 2008 4:05 am 
Hibernate Team
Hibernate Team

Joined: Tue Aug 26, 2003 6:10 am
Posts: 8615
Location: Neuchatel, Switzerland (Danish)
question not related to tooling. please use the normal user forum.

_________________
Max
Don't forget to rate


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.