0
工作時與串測試休眠條件查詢不注日期
criteria.add(Restrictions.eq("name", "John"));
然而,當我與日期測試它下面的代碼行完美的作品返回錯誤 這行代碼返回錯誤
criteria.add(Restrictions.eq(currentDate,dd));
我這是怎麼得到的currentdate
DateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
Calendar cal = Calendar.getInstance();
String currentDate=dateFormat.format(cal.getTime());
我印刷的currentdate和DD和下面是在控制檯輸出與所述誤差
當前日期沿着:2014年2月17日 DD:2014年2月16日
JKInsrException: - >無法解析屬性:2014年2月17日的:com.java.JKInsr.Contact
非常感謝......它爲我工作。我搞砸了語法。 –