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
|