apfuse2.0.2 nested exception is org.hibernate.hql.ast.QuerySyntaxException: Otacity is not mapped

来源:互联网 发布:tpp播放软件 编辑:程序博客网 时间:2024/05/16 11:24
 1.在登录appfuse项目查询对象列表时,报错:在使用return super.getHibernateTemplate().find("from Otacity");进行结果查询的时候:异常信息:Otacity is not mapped [from Otacity]; nested exception is org.hibernate.hql.ast.QuerySyntaxException: Otacity is not mapped [from Otacity]经查找发现 project/src/main/resources/hibernate.cfg.xml 文件中仅有 这里appfuse没有自动添加,需要手动添加. 已经证实没有添加这个的时候查询结果为02.另外,在原始的appfuse自动生成代码中,只有下面的getAll方法,而如果没有在cfg文件中添加映射,则执行下面的方法也不报错,但是结果记录数为0. public List getAll() { return super.getHibernateTemplate().loadAll(this.persistentClass); }
原创粉丝点击