读书人

org.hibernate.hql.ast.QuerySyntaxEx

发布时间: 2013-11-20 12:46:02 作者: rapoo

org.hibernate.hql.ast.QuerySyntaxException: p_user is not mapped [from p_user]

org.hibernate.hql.ast.QuerySyntaxException:?p_user is not mapped [from?p_user]

实体类用的注解:

@Entity

@Table(name = "p_user")

public class User {

...........

}

报这个错,搞了半天才能明白,这是HQL查询,面向对象,跟SQL不一样,所以在写HQL语句时,要写成from User。

读书人网 >软件架构设计

热点推荐