当前所在位置:珠峰网资料 >> 计算机 >> 计算机等级考试 >> 正文
hibernate存储过程返回结果集列名无效
发布时间:2011/1/23 16:05:06 来源:城市学习网 编辑:ziteng

  <?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列是同一个值。

广告合作:400-664-0084 全国热线:400-664-0084
Copyright 2010 - 2017 www.my8848.com 珠峰网 粤ICP备15066211号
珠峰网 版权所有 All Rights Reserved