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());
}