关于.getHibernateTemplate().find(hql.toString()) 不执行的问题

窑洞里敲代码 发布于 2016/09/14 12:21
阅读 554
收藏 0
代码如下:
@Override
	public RoomIn findByInNo(String inNo) {
		System.out.println("findByInNo=="+inNo);
		StringBuilder hql=new StringBuilder()
				.append("from RoomIn where inNo='"+inNo+"'");

//		System.out.println("findByInNo2=="+inNo);

		List<RoomIn> list=(List<RoomIn>) super.getHibernateTemplate().find(hql.toString());
		System.out.println("findByInNo==1111111111111");
		System.out.println("list.size()=="+list.size());
		RoomIn roi=(RoomIn) list.get(0);
		System.out.println("findByInNo(String inNo)=="+roi);
		return roi;

}


控制台信息:

findByInNo==R20160913114851 Hibernate:      select         roomin0_.IN_ID as IN_ID1_4_,         roomin0_.IN_NO as IN_NO2_4_,         roomin0_.MONEY_ROOM as MONEY_RO3_4_,         roomin0_.CUSTOMER_NAME as CUSTOMER4_4_,         roomin0_.ROOM_NO as ROOM_NO5_4_,         roomin0_.IN_MONEY as IN_MONEY6_4_,         roomin0_.IN_TUIFEI as IN_TUIFE7_4_,         roomin0_.CUSTOMER_CARDNO as CUSTOMER8_4_,         roomin0_.IN_TYPE as IN_TYPE9_4_,         roomin0_.IN_ROOM_STATUS as IN_ROOM10_4_,         roomin0_.IN_STATUS as IN_STAT11_4_,         roomin0_.IN_DATE as IN_DATE12_4_,         roomin0_.OUT_DATE as OUT_DAT13_4_,         roomin0_.OUT_DATE_SHIJI as OUT_DAT14_4_,         roomin0_.IN_DAYS as IN_DAYS15_4_,         roomin0_.USER_ID as USER_ID16_4_,         roomin0_.TUI_USER_ID as TUI_USE17_4_      from         ROOM_IN roomin0_      where         roomin0_.IN_NO='R20160913114851'

为什么查询把语句打印出来就不继续执行了?我把语句复制到数据库是可以查到的



加载中
0
skhuhu
skhuhu
数据太多了吧
窑洞里敲代码
已经解决了,原来是实体的关联错误,系统也不报错,一顿好找
返回顶部
顶部