关于hibernate对sqlserver中表做count操作时的错误

peihexian peihexian 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
表结构

/*==============================================================*/
/* Table: customer_unit_info */
/*==============================================================*/
create table customer_unit_info (
customer_unit_id numeric identity,
unit_id integer null,
card_number varchar(20) not null,
customer_unit_name varchar(70) not null,
customer_unit_manager varchar(12) null,
customer_unit_bank_name varchar(50) not null,
customer_unit_bank_code varchar(30) not null,
customer_unit_address varchar(70) null,
customer_unit_phone varchar(20) null,
customer_unit_phone2 varchar(20) null,
customer_unit_postcode varchar(8) null,
customer_unit_fax varchar(20) null,
constraint PK_CUSTOMER_UNIT_INFO primary key (customer_unit_id)
)
go

对应的hbm文件内容

<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 2.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd" >

<!-- DO NOT EDIT: This is a generated file that is synchronized -->
<!-- Created Mon Oct 18 17:26:30 CST 2004 -->
<hibernate-mapping package="com.bkgd.water.dao.tables">

<class name="CustomerUnitInfo" table="customer_unit_info">
<id name="customerUnitId" column="customer_unit_id" type="java.lang.Long">
<generator class="identity"/>
</id>

<property name="unitId" column="unit_id" type="java.lang.Integer" />
<property name="cardNumber" column="card_number" type="java.lang.String" not-null="true" />
<property name="customerUnitName" column="customer_unit_name" type="java.lang.String" not-null="true" />
<property name="customerUnitManager" column="customer_unit_manager" type="java.lang.String" />
<property name="customerUnitBankName" column="customer_unit_bank_name" type="java.lang.String" not-null="true" />
<property name="customerUnitBankCode" column="customer_unit_bank_code" type="java.lang.String" not-null="true" />
<property name="customerUnitAddress" column="customer_unit_address" type="java.lang.String" />
<property name="customerUnitPhone" column="customer_unit_phone" type="java.lang.String" />
<property name="customerUnitPhone2" column="customer_unit_phone2" type="java.lang.String" />
<property name="customerUnitPostcode" column="customer_unit_postcode" type="java.lang.String" />
<property name="customerUnitFax" column="customer_unit_fax" type="java.lang.String" />
</class>

</hibernate-mapping>



...全文
评论 14
收藏 已收藏
分享
返回顶部
peihexian
Java EE 67,535 成员 225,843 内容