-->
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: Oracle function called dynamically by Hibernate
PostPosted: Thu Jan 31, 2008 3:43 pm 
Newbie

Joined: Thu Jan 31, 2008 3:35 pm
Posts: 1
Hi,

I have implemented hibernate and spring to successfully call my oracle function and return a resultset which hibernate maps to my java class. I followed the same approach as seen in the hibernate docs...

<sql-query name="selectAllEmployees_SP" callable="true">
<return alias="emp" class="Employment">
<return-property name="employee" column="EMPLOYEE"/>
<return-property name="employer" column="EMPLOYER"/>
<return-property name="startDate" column="STARTDATE"/>
<return-property name="endDate" column="ENDDATE"/>
<return-property name="regionCode" column="REGIONCODE"/>
<return-property name="id" column="EID"/>
<return-property name="salary">
<return-column name="VALUE"/>
<return-column name="CURRENCY"/>
</return-property>
</return>
{ ? = call selectAllEmployments() }
</sql-query>


What i am now looking to now do is, given a list of function names (which all return the same resultset) create a hibernate query similar to the one seen above that takes the function name in as a parameter i.e. { ? = call FUNC_NAME_AS_STRING_VAR }

Is this possible in hibernate ? Or can you only hardcode in the query name and seen in the above sample ??

Any help or guidence would be greatly appreciated,
Thanks


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.