日期:2014-05-20  浏览次数:20768 次

this.getHibernateTemplate().find(hql.toString());问题
List list= this.getHibernateTemplate().find(hql.toString());
发出SQL语句

select leg.destcode from Leg leg left join leg.flight flt where leg.destcode='HAK' and leg.tmatd <= to_date('2011-10-19 13:30','yyyy-MM-dd HH24:mi') and leg.tmatd >= to_date('2011-10-19 10:30','yyyy-MM-dd HH24:mi') order by leg.tmatd desc 
14:16:59,718 INFO [STDOUT] Hibernate: 
  /* select
  leg.destcode 
  from
  Leg leg 
  left join
  leg.flight flt 
  where
  leg.destcode='HAK' 
  and leg.tmatd <= to_date('2011-10-19 13:30','yyyy-MM-dd HH24:mi') 
  and leg.tmatd >= to_date('2011-10-19 10:30','yyyy-MM-dd HH24:mi') 
  order by
  leg.tmatd desc */ select
  leg0_.LEG_DESTCITY as col_0_0_ 
  from
  VIEW_TA_LEG leg0_ 
  left outer join
  TA_FLIGHT flight1_ 
  on leg0_.FLT_ID=flight1_.FLT_ID 
  where
  leg0_.LEG_DESTCITY='HAK' 
  and leg0_.LEG_TMATD<=to_date('2011-10-19 13:30', 'yyyy-MM-dd HH24:mi') 
  and leg0_.LEG_TMATD>=to_date('2011-10-19 10:30', 'yyyy-MM-dd HH24:mi') 
  order by
  leg0_.LEG_TMATD desc
然后用这句SQL语句到数据库中执行可以得到数据,但现在list里面却是“”空串,求大侠帮忙

------解决方案--------------------
把打出来的sql放在plsql执行,看看有错误没。。
debug一下看看返回的list是否真是空啊。