2 Replies Latest reply on Jun 20, 2006 4:31 PM by Dan Liu

    ejb3 question, Compare date only for a TIMESTAMP field?

    Dan Liu Apprentice

      I know it's a wrong place to post it here but still worth a try since i can't get answer from ejb3 forum.

      I have a date field defined as Temporal.TIMESTAMP. There seem to be a problem If I want to compare its date without check time. Here is my hql:
      em.createQuery("from A a where a.datetime=:date").setParameter("date",new Date(),Temporal.DATE);

      This fails unless I define my date filed as Temporal.DATE. As I need both time and date mostly, i have to define it as Temporal.TIMESTAMP. Is there anyway to achive this in ejb ql?