Exception in thread "main" org.hibernate.hql.internal.ast.QuerySyntaxException: student is not mapped [from student] 研究了一下发现,原来是HQL查询是基于持久化类查询,而不是基于数据库,我的数据库表是student,而类是Student,所以就出错了,正确应该是from Student…
---恢复内容开始--- 开发中遇到的一个小问题,使用Hibernate中的HQL查询时,使用query.list()查询出来的是一个List<Object>结果集 原来代码: public List findDataByProvince(String yxszsdm, int year) { StringBuffer sql=new StringBuffer(); sql.append("SELECT * FROM employment_status WHERE sfdm=:sfd…
因为一直报实体类空异常,去网上查了资料只查到了并没有查到数据库空值时不给实体类赋值的属性 异常 org.hibernate.InvalidMappingException: Could not parse mapping document from resource cn/pojo/EmpDao.xml at org.hibernate.cfg.Configuration.addResource(Configuration.java:) at org.hibernate.cfg.Configur…