Hql查询后的类转换异常

Simple_Key Simple_Key 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
public static void main(String[] args) {
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

AI技术达摩院

HQL 连接查询

HQL 连接查询

wancanjun

HibernateUtil分装完整版HQL查询

HibernateUtil分装完整版HQL查询HibernateUtil分装完整版HQL查询

Muxiyale

hql语句大全hql语句大全

hql语句大全hql语句大全hql语句大全hql语句大全hql语句大全hql语句大全hql语句大全hql语句大全hql语句大全hql语句大全hql语句大全hql语句大全hql语句大全hql语句大全hql语句大全hql语句大全hql语句大全

fobcclkm

HQL连接查询和注解使用总结

HQL是指定连接查询方式,而且显式指定了关联级别的查询策略

浩辰----
评论 11
收藏 已收藏
分享
返回顶部
Simple_Key
Java EE 67,535 成员 225,843 内容