Hi guys I have an SQL query like this:
SELECT * FROM PEOPLE P WHERE to_char(P.BIRTH_DATE,'DD/MM/YYYY') = '01/06/2012'
I want to run this query via Hibernate Restrictions API. I think the following won’t do the same work:
Restrictions.eq(People.PROP_BIRTH_DATE, Calendar.getInstance())
How can I create such a restriction?
or
The above supposes that the birth date is stored as a date in database, and not as a timestamp. If the birth date in database is a timestamp, and thus has a time portion, the portable way of doing that is: