这听起来是一个非常简单的问题,但我现在最难找到如何抓住今天更新的所有条目。
def today = new Date()
def q = "from UserMapping as u where u.updateTime like :today"
def updated = UserMapping.findAll(q, [today: today])
java.lang.String cannot be cast to java.util.Date. Stacktrace follows:
我尝试过其他10种方法,但我无法弄清楚。
答案 0 :(得分:2)
我用以下方法解决了它:
def today = new Date().clearTime()
def updated = UserMapping.findAllByUpdateTimeGreaterThanEquals(today)
如果有人有更优雅的方法,请发布。