转自: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了

相关文章:

  • 2021-10-15
  • 2022-12-23
  • 2021-09-24
  • 2022-12-23
  • 2022-12-23
  • 2021-06-16
  • 2022-01-23
猜你喜欢
  • 2022-12-23
  • 2021-12-08
  • 2021-05-11
  • 2022-12-23
  • 2021-10-12
  • 2021-04-16
  • 2022-12-23
相关资源
相似解决方案