org.hibernate.hql.ast.QuerySyntaxException: tb_voteoption is not mapped [from tb_voteoption where voteID=?]

转自:https://www.cnblogs.com/albert1017/archive/2012/08/25/2656873.html

org.hibernate.hql.ast.QuerySyntaxException: tb_voteoption is not mapped [from tb_voteoption where voteID=?]

解决方案:
这一般是HQL语句错误
因为Hibernate是对类查询的 ,而不是对数据库表进行查询
例如:
return getHibernateTemplate().find("from organization o where o.parent.id=?", new Integer(parentId));
organization 是数据库中的表,而organization 对应的类是Organization.java,现在只需要将teachers改为Teachers就可以了,即
我们将 "from organization o where o.parent.id=?" 改成
"from Organization o where o.parent.id=?"就ok了

上一篇:R read.tabe line 5 did not have 2 elements


下一篇:两个php.ini; ubuntu下配置文件