首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > 编程 >

Hibernate查询语句错误

2013-03-06 
Hibernate查询语句异常org.hibernate.hql.ast.QuerySyntaxException: unexpected token: class near line

Hibernate查询语句异常
org.hibernate.hql.ast.QuerySyntaxException: unexpected token: class near line 1, column 6 [from class cn.itcast.oa.domain.Department]

   错误是因为:hql语句有问题
        @Override
public Collection<T> getAllEntry() {
return this.hibernateTemplate.find("from " + this.clazz);
}
   应该为:
        @Override
public Collection<T> getAllEntry() {
return this.hibernateTemplate.find("from " + this.clazz.getName());
}

热点排行