开发者

Criteria hibernate

my code

session.createCriteria(Input.class);
      DateFormat format = 
new SimpleDateFormat("yyyy-MM-dd hh:mm:ss");
      Date startDate = 
(Date)format.parse("2005-01-01 00:00:00");
      Date endDate = 
(Date)format.parse("2005-03-03 00:00:00");
      crit.add(Expression.between
("inputDate", new Date(startDate.getTime()),
 new Dat开发者_Go百科e(endDate.getTime()))); 

This code return a list, but there is no element present in it. i think it doesn't match the condition. Anybody help.


Try this as your last statement:

crit.add(Expression.between("inputDate", startDate, endDate));
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜