我想了更多,解决办法可能是用另一种方式攻击它。与其尝试在休眠级别执行 toDateTime(zone),不如在更高级别执行 - 即在创建开始->结束搜索条件时;
DateTimeZone toZone = DateTimeZone.forID("Europe/London");
DateTime now = new DateTime()
DateTime today = new DateTime(now.year, now.monthOfYear, now.dayOfMonth, 0, 0, 0, 0)
DateTime yesterday = today.minusDays(1)
def queryStr = "from JODATesting j where j.thedate > :date1 and j.thedate < :date2"
for (JODATesting joda: JODATesting.executeQuery(queryStr, [date1: yesterday, date2: today]) ) {
println("##### Joda"+joda.id +"=" +joda.thedate.toDateTime(toZone));
}