请问在hibernate 里按时间查询是不是很麻烦啊 我在MYSQL里是DATE类型 写HQL语句怎么弄都是错
求指教啊我的代码是
str="from LiveApplication c where c.appLiveInfo.appTime=:apptimes" +
"and c.name='"+name+"'";……
Query q=(Query)s.createQuery(str).setTimestamp("apptimes", apptime);
List<LiveApplication> cs=q.list();
求指教啊我的代码是
str="from LiveApplication c where c.appLiveInfo.appTime=:apptimes" +
"and c.name='"+name+"'";……
Query q=(Query)s.createQuery(str).setTimestamp("apptimes", apptime);
List<LiveApplication> cs=q.list();
"and c.name:name";
query.setParameter("apptimes", "时间");
query.setParameter("name", "名称");
String hql="from Users u where u.downloadTime BETWEEN '"+startTime+"' and '"+endTime+"' ORDER BY u.downloadTime";
这种,这种我也试过。