<?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">
<!--
Mapping file autogenerated by MyEclipse Persistence Tools
-->
<hibernate-mapping>
<class name="net.yjiasoft.sss.query.QueryAllBillFinish" table="temp" mutable="false">
<id name="id" type="java.lang.Integer">
<column name="id"></column>
<generator class="identity"></generator>
</id>
<many-to-one name="billMasterAll" class="net.yjiasoft.sss.table.BillMasterAll" lazy="false" fetch="join"
column="billId"
not-null="true"
unique="true"/>
<property name="vchSumTo" type="java.lang.Double"/>
<property name="gatherSumTo" type="java.lang.Double"/>
<property name="balanceSumTo" type="java.lang.Double"/>
<property name="ignoreSumTo" type="java.lang.Double"/>
<property name="isFinished" type="java.lang.Integer"/>
<property name="subCount" type="java.lang.Integer"/>
</class>
<sql-query name="P_QueryAllBillFinish" callable="true">
<return alias="queryAllBillFinish" class="net.yjiasoft.sss.query.QueryAllBillFinish">
<return-property name="id" column="sid"></return-property>
<return-property name="billMasterAll" column="billId"></return-property>
<return-property name="vchSumTo" column="vchSumTo"></return-property>
<return-property name="gatherSumTo" column="gatherSumTo"></return-property>
<return-property name="balanceSumTo" column="balanceSumTo"></return-property>
<return-property name="ignoreSumTo" column="ignoreSumTo"></return-property>
<return-property name="isFinished" column="isFinished"></return-property>
<return-property name="subCount" column="subCount"></return-property>
</return>
{call YP_QueryAllBillFinish(?,?,?,?,?)}
</sql-query>
</hibernate-mapping>
<return-property name="id" column="sid"></return-property>去掉,然后把标识中的两个name属性都改为billId,就会提示billId列无效,不知为什么。不知道是不是标识列和外键(many-to-one)使用的是同一列的原因。后来我在存储过程返回的结果集中增加了sid列,这个值和billId列是同一个值。