-->
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: Hibernate mapping with stored proc and table join
PostPosted: Tue Aug 16, 2011 12:26 pm 
Newbie

Joined: Tue Aug 16, 2011 9:35 am
Posts: 2
I am rewriting an app for a legacy system that has already created many stored procedures. I have gotten a "fetch" to work calling an existing stored procedure initially created in Oracle defined with a SYS_REFCURSOR as an OUT parameter. Issue is that the stored procedure contains a query with a few table joins. I am trying to figure out the mapping that needs to be constructed in the ...hbm.xml configuration file. I have the following:
<!-- mapping for table 1 -->
<class name="com.somepackage.table1" table="table1">
<id name="table1id">
<generator class="native"/>
</id>
<property name="secondcol"/>
<many-to-one name="table2" class="com.somepackage.table2" column="table2fk" not-null="true"/>
</class>

<!-- mapping for table 2 -->
<class name="com.somepackage.table2" table="table2">
<id name="table2id">
<generator class="native"/>
</id>
<property name="secondcol"/>
</class>

I have the corresponding POJOs with getters and setters. If I comment the "<many-to-on...", the code works fine. If not, I get the "Unable to instantiate default tuplizer" exception. I included the javassist-3.4.GA.jar so this does not seem to be the issue. I get the same result when dropping my SELECT stmt. from the stored procedure into the ...hbm.xml file.


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.