hibernate吧 关注:2,522贴子:3,001
  • 0回复贴,共1

hibernate 查询的条件是一个timestamp类型怎么破,在线等

只看楼主收藏回复

用的是纯hibernate没有用框架的Spring,想查找某一天的所有记录,代码是这样写的
1、List<Record> rr=se.createQuery("from Record where Recorddate like '"+ydate+"%'").list();
Record是我的实体类,
2、List<Record> rr=se.createQuery("from Record ).list();这样程序就是好的,是我想要的结果
3、List<Record> r=se.createSQLQuery("select *from Record where date like '" +ydate+" %'").list();用这个sql语句得到的在jsp页面上用不了${***.**}取值就是错误,,谢谢大家了。


1楼2015-12-29 19:23回复