С API критериев JPA (тестируется только в Hibernate):
// Create expressions that extract date parts:
Expression<Integer> year = cb.function("year", Integer.class, date);
Expression<Integer> month = cb.function("month", Integer.class, date);
Expression<Integer> day = cb.function("day", Integer.class, ts);
// Create expressions that extract time parts:
Expression<Integer> hour = cb.function("hour", Integer.class, time);
Expression<Integer> minute = cb.function("minute", Integer.class, time);
Expression<Integer> second = cb.function("second", Integer.class, ts);
Источник: http://www.objectdb.com/java/jpa/query/jpql/date#Date_and_Time_in_Criteria_Queries_
С jpql (тестируется только в Hibernate):
YEAR(date)
MONTH(date)
DAY(date)
HOUR(date)
MINUTE(date)
SECOND(date)