org.hibernate.hql.ast.QuerySyntaxException per is not mapped [from Per as p]

来源:互联网 发布:mac好用的解压缩软件 编辑:程序博客网 时间:2024/06/11 19:47

org.hibernate.hql.ast.QuerySyntaxException per is not mapped [from Per as p]

 

1.hql语句查寻的是javabean 与javabean名字相同,注意大小写!
2.hibernate.cfg.xml中要有<mapping resource="bbs/BBSManager.hbm.xml" />之类的语句

注意:from Per as p 中的Per是持久类名称而不是实际数据中表的名称!

 

1、持久类写错了,要不就是写成了数据库表名
2、hibernate3.0不支持select中嵌套查询,据说from中也不行,只支持where中嵌套查询,好像3.1支持了select中嵌套
3、sql语句中字段是用了保留关键字

原创粉丝点击