开发者

Extracting year and month with ejbql

开发者 https://www.devze.com 2022-12-20 04:59 出处:网络
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) ?

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

精彩评论

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

关注公众号