How do I use Criteria to make a join on a date field (in DB2) based on the year.
- by HtmlTableGuru
I have a java.util.Date field in my Object. I would like to use Criteria to select all rows that have a date field with a given year. The SQL would look like the following:
SELECT *
FROM GAME GM
WHERE YEAR(GM.GAME_DATE) = 2010
How can I use Criteria to accomplish this? Thanks in advance.
public Collection<Game> getGamesByDate(Date…