Hibernate异常:org.Hibernate.exception.SQLGrammarException:无法执行查询
我得到以下错误。不知道为什么会这样。我还检查了DB,看起来不错Hibernate异常:org.Hibernate.exception.SQLGrammarException:无法执行查询,hibernate,exception,Hibernate,Exception,我得到以下错误。不知道为什么会这样。我还检查了DB,看起来不错 Hibernate: select customer0_.CustomerId as CustomerId0_, customer0_.CustomerAlias as Customer2_0_ from FF_REFERENCE.dbo.Customer customer0_ where customer0_.CustomerId=? org.hibernate.exception.SQLGrammarException: co
Hibernate: select customer0_.CustomerId as CustomerId0_, customer0_.CustomerAlias as Customer2_0_ from FF_REFERENCE.dbo.Customer customer0_ where customer0_.CustomerId=?
org.hibernate.exception.SQLGrammarException: could not execute query
Caused by: java.sql.SQLException: [Macromedia][Sybase JDBC Driver]**Invalid column name: CustomerId0_**
我的目标是:
public class Customer implements java.io.Serializable {
// Fields
private String customerId;
private String customerAlias;
}
hbm是:
<hibernate-mapping>
<class name="com.pojo.reference.Customer" table="Customer" >
<id name="customerId" column ="CustomerId" length="18" />
<property name="customerAlias" type="java.lang.String">
<column name="CustomerAlias" length="18" />
</property>
我打电话是用:
custDao.findByProperty("customerId", custName, region);
我知道答案了。部署的战争把hbm从错误的地方带走了…嗨。当你说从错误的地方拿hbm的时候。你能详细说明一下吗??因为我想我可能也有同样的问题
custDao.findByProperty("customerId", custName, region);