资讯   |   开发   |   选机中心   |   产品大全 | IBM | 惠普 | 联想 | 戴尔 | 苹果 | 神舟
更多: | 华硕 | 明基 | 方正 | 紫光 | TCL | 夏新 | 联宝 | 宏碁 | 七喜 | 长城 | 清华同方 | 海尔 | 三星 | 东芝 | 索尼 | 富士通 | LG | 技术 | ddnoon
当前位置:笔记本 > 软件开发 >
Advertisement
文章正文

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

类型:转载   责任编辑:asp.net   日期:2007/05/23


热门软件下载:


   

表结构  
   
  /*==============================================================*/  
  /*   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>  
   
   
   
 

网友回答:

发表者:sgdb

select   count(c)   from   CustomerUnitInfo   c

发表者:yz790724

UP

发表者:dengyin2000

count(*)   from   Archive   arch   where   arch.category   =   java

发表者:zhigangsun

好像hibernate对聚合函数支持的不是很好哦。

发表者:trk_computer

你把TOMCAT停下来  
  然后的work目录删了  
  再重新启动TOMCAT  
  试试看


 

 
热门推荐笔记本: 顶星笔记本
相关文章:
webmaster:popbb@126.com   最佳浏览:1024X768 MSIE
©2007 popbb.net All Rights Reserved