Need help with Hibernate? Read this first:
http://www.hibernate.org/ForumMailingli ... AskForHelp
3.0:
Oracle 9:
I have a stored procedure that calculates values from multiple tables. This procdure returns these values in a reslut set. The result set return does not map to a specific table in the db. can i map this result set to an entity in the mapping file? If im not mapping to a table how can I leave out the class element, id element and just have the sql-query element? is this possible?
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<hibernate-mapping>
<sql-query name="myOracleStoredProcudure" callable="true">
<return alias="uploadStats" class="com.acme.mypackage.portalhome.UploadStats">
<return-property name="employeeUploaded" column="emp_uploaded"/>
<return-property name="employeeNotUploaded" column="emp_not_uploading"/>
<return-property name="totalClaims" column="total_claims"/>
<return-property name="toatalSupplements" column="total_supplements"/>
<return-property name="busiestDay" column="busiest_day"/>
</return>
{? = call pkg.myOracleStoredProcudure() }
</sql-query>
</hibernate-mapping>