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.
精彩评论