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。

猜你喜欢

转载自zfq0714.iteye.com/blog/1974718