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
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
Get the date, and do it in your code. You can use Java Calendar
API for this.
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.