Hql查询后的类转换异常
CateService bh = (CateService) BeanHome.getBean("CateService");
System.out.println(bh);
List<TbWcProvince> list = bh.selectProvince();
for (int i = 0; i < list.size(); i++) {
System.out.println(list.get(i).getName());
List<TbWcCity> listcity = bh.selectCity(list.get(i).getProvince());
for (int j = 0; j < listcity.size(); j++) {
System.out.println(listcity.get(j).getName());
}
}
}
com.covics.business.CateService@b533b8
Hibernate: select tbwcprovin0_.province as province0_, tbwcprovin0_.name as name0_, tbwcprovin0_.isEnable as isEnable0_, tbwcprovin0_.memo as memo0_, tbwcprovin0_.createdDate as createdD5_0_, tbwcprovin0_.lastModifiedDate as lastModi6_0_ from Tb_WC_Mob_Province tbwcprovin0_
广东
Hibernate: select tbwccity0_.name as col_0_0_ from Tb_WC_Mob_City tbwccity0_, Tb_WC_Mob_Province tbwcprovin1_ where tbwccity0_.province=tbwcprovin1_.province and tbwcprovin1_.province=?
Exception in thread "main" java.lang.ClassCastException: java.lang.String
at cn.test.Test.main(Test.java:30)
我可以直接拿到listcity的值 但是listcity.get(j).getName()拿到话就会报上面那个异常 哪位大哥能告诉小弟原因
相关推荐
Hibernate HQL查询 分页查询 模糊查询.docx
Hibernate HQL查询 分页查询 模糊查询.docxHibernate HQL查询 分页查询 模糊查询.docxHibernate HQL查询 分页查询 模糊查询.docxHibernate HQL查询 分页查询 模糊查询.docxHibernate HQL查询 分页查询 模糊查询.docxHibernate HQL查询 分页查询 模糊查询.docxHibernate HQL查询 分页查询 模糊查询.docxHibernate HQL查询 分页查询 模糊查询.docxHibernate HQL查询 分页查询 模糊查询.docxHibernate HQL查询 分页查询 模糊查询.docxHibernate HQL查询 分页查询 模糊查询.docxHibernate HQL查询 分页查询 模糊查询.docxHibernate HQL查询 分页查询 模糊查询.docxHibernate HQL查询 分页查询 模糊查询.docxHibernate HQL查询 分页查询 模糊查询.docxHibernate HQL查询 分页查询 模糊查询.docxHibernate HQL查询 分页查询 模糊查询.docxHibernate HQL查询 分页查询 模糊查询.docxHibernate HQL查询 分页查询 模糊查询.docxHibernate HQL查询 分页查询 模糊查询.docxHibernate HQL查询 分页查询 模糊查询.docxHibernate HQL查询 分页查询 模糊查询.docxHibernate HQL查询 分页查询 模糊查询.docxHibernate HQL查询 分页查询 模糊查询.docxHibernate HQL查询 分页查询 模糊查询.docxHibernate HQL查询 分页查询 模糊查询.docxHibernate HQL查询 分页查询 模糊查询.docxHibernate HQL查询 分页查询 模糊查询.docxHibernate HQL查询 分页查询 模糊查询.docxHibernate HQL查询 分页查询 模糊查询.docxHibernate HQL查询 分页查询 模糊查询.docx
HQL 连接查询
HQL 连接查询
HibernateUtil分装完整版HQL查询
HibernateUtil分装完整版HQL查询HibernateUtil分装完整版HQL查询
hql语句大全hql语句大全
hql语句大全hql语句大全hql语句大全hql语句大全hql语句大全hql语句大全hql语句大全hql语句大全hql语句大全hql语句大全hql语句大全hql语句大全hql语句大全hql语句大全hql语句大全hql语句大全hql语句大全
HQL连接查询和注解使用总结
HQL是指定连接查询方式,而且显式指定了关联级别的查询策略


