Hello,
I'm kind of new with hibernate and I'd like to use existing stored procedure from my database.
Looking in the kind of short hibernate documentation on the subject, it appears that it is necessary to specify the returned fields from the stored proc in a mapping file.
1. My first question is : Is it possible to specify several types of returns (like in the following example) ?
Code:
<sql-query name="selectAllEmployees_SP" callable="true">
<return alias="pers" class="Person">
<return-property name="name" column="NAME"/>
<return-property name="age" column="AGE"/>
</return>
<return alias="emp" class="Employment">
<return-property name="employee" column="EMPLOYEE"/>
<return-property name="employer" column="EMPLOYER"/>
</return>
{ ? = call selectAllEmployments() }
</sql-query>
2. The second question is : In which file should I define the mapping ?
3. The final question is : How do i call the stored proc in my java code ?
Many thanks :o)