Search Oracle date type column with hibernate, seach by everything in that day - ignore the time.

Posted by Setori on Stack Overflow See other posts from Stack Overflow or by Setori
Published on 2010-05-14T05:39:07Z Indexed on 2010/05/14 5:44 UTC
Read the original article Hit count: 243

Filed under:
|
|
|

hi there

<property name="batchCreatedDate" type="java.util.Date">
  <meta attribute="field-description">batch create date</meta>
  <column name="BATCH_CREATED_DATE" length="7" not-null="true" />
</property>

table column type is

BATCH_CREATED_DATE  DATE            NOT NULL

With the data in that date column being similar to this '2010-05-13 14:56:36.0'

now I want to search for all items within the 24 hours of 2010-05-13, currently my call only returns all items with date "2010-05-13 14:56:36.0" exactly.

What would my HQL statement look like to hand this kind of scenario?

Thank you so much

© Stack Overflow or respective owner

Related posts about hibernate

Related posts about Oracle