《求助》Identify is not mapped [select count(*) from Identify ]
错误:Struts has detected an unhandled exception:
Messages: Identify is not mapped [select count(*) from Identify ]
File: org/hibernate/hql/internal/ast/util/SessionFactoryHelper.java
Line number: 180
--------------------------------------------------------------------------------
Stacktraces
org.hibernate.hql.internal.ast.QuerySyntaxException: Identify is not mapped [select count(*) from Identify ]
org.hibernate.hql.internal.ast.util.SessionFactoryHelper.requireClassPersister(SessionFactoryHelper.java:180)
org.hibernate.hql.internal.ast.tree.FromElementFactory.addFromElement(FromElementFactory.java:110)
org.hibernate.hql.internal.ast.tree.FromClause.addFromElement(FromClause.java:93)
appraise.hbm.xml
<?xml version="1.0" encoding="utf-8"?>--------------------编程问答-------------------- 看你hbm里是Appraise映射identify表
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 4.0//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
<!-- student.hbm.xml -->
<hibernate-mapping>
<class name="willow.entity.science.Appraise" table="identify" catalog="hawk">
<id name="id" type="java.lang.String">
<column name="id" length="25"><comment>序号</comment></column>
<generator class="assigned" />
</id>
<property name="rname" type="java.lang.String">
<column name="name" length="25"><comment>成果名称</comment></column>
</property>
<property name="author" type="java.lang.String">
<column name="author" length="19"><comment>完易做图</comment></column>
</property>
<property name="organization" type="java.lang.String">
<column name="organization" length="20"><comment>主持鉴定单位</comment></column>
</property>
<property name="itime" type="java.lang.String">
<column name="itime" length="20"><comment>鉴定日期</comment></column>
</property>
<property name="ranking" type="java.lang.String">
<column name="ranking" length="50"><comment>排名</comment></column>
</property>
<property name="rtime" type="java.lang.String">
<column name="rtime" length="15"><comment>登记年份</comment></column>
</property>
<many-to-one name="result" column="result" not-null="true"/>
<many-to-one name="project" column="project" not-null="true"/>
</class>
</hibernate-mapping>
<class name="willow.entity.science.Appraise" table="identify" catalog="hawk">
那么你应该select count(*) from Appraise啊
类名表名差这么大,不知道你故意的还是失误 --------------------编程问答-------------------- hibernate是针对对象操作的 --------------------编程问答-------------------- 一针见血 --------------------编程问答-------------------- --------------------编程问答-------------------- 1楼+1 --------------------编程问答-------------------- 我去,1楼一眼就看到了! --------------------编程问答-------------------- 1楼基础够扎实,一针见血! hibernate操作的是对象 --------------------编程问答-------------------- 1楼已经说明了
补充:Java , Java EE