请参阅参考文档中的使用存储过程进行查询。
映射的查询这样来称呼。
List employment = sess.getNamedQuery("BigSP")
.list();
映射查询可以返回实体。
<sql-query name="BigSP" 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 BigSP }
</sql-query>