开发者

Extracting year and month with ejbql

Is it possible to get the year or month out from a date filed with ejbql like this pseudo code select year(createdDate), 开发者_如何转开发name from table group by year(createdDate) ?

Best regards Anders Olme


No, you must examine the Date object that the query returns yourself by converting it to a Calendar and then using get(Calendar.YEAR) on it.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜