看错误信息,是不是执行前需要格式化下日期,好像hibernate把时间中的 :00 解析成SQL的命名参数了。

解决方案 »

  1.   

    楼上的说的很好,好象错误提示就是这个意思,我说怎么会有named   parameters的呢.你在fromDate,toDate也象' "+offType+ " '这种格式试看看呢.
      

  2.   

     Not   all   named   parameters   have   been   set
      

  3.   

    searchString="from rdis.domain.da.DaOffence as model where model.offenderTypeInd='"+offType+"' and model.offenceDte  between "+fromDate+" and "+toDate; 
    SQL语句好像有问题
    把单引号去掉试试
    searchString="from rdis.domain.da.DaOffence as model where model.offenderTypeInd="+offType+" and model.offenceDte  between "+fromDate+" and "+toDate; 
      

  4.   

    不好的习惯,把searchString中的参数都修改为?,
    然后find方法中把参数值传进去,日期格式化问题,hibernate将为你处理