我們最近一個項目用hibernate+Spring做,系統的學習了一下,並把自己出現的問題記下來,供以後參考。
問題: org.springframework.orm.hibernate3.HibernateQueryException: mora_b2c_customer is not mapped [from mora_b2c_customer where devno like '%132%']; nested exception is org.hibernate.hql.ast.QuerySyntaxException: mora_b2c_customer is not mapped [from mora_b2c_customer where devno like '%132%']
原因:hibernate 中HQL語言是對象查詢,映射java中的屬性,把mora_b2c_customer表名改成Customer類名就沒有問題了。