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>
|
|