what precision you want? a day as the smallest time unit?
1. you have a representation of that Date in Java as a java.util.Date i guess? If so you, i do something like:
* i take that Date and create two new Dates -- the beginnig of a day and end of a day. simple if you use the java.util.Calendar
* use Restriction.between or combination of Restrictions.le || Restrictions.gt and make input both of the newly created dates as a interval -- the query generated contains st like: whete ? < dateProperty and dateProperty < ? -- you choose anything that lies between the interval boundaries
2. you may create your column as a date (to store only yyyy-mm-dd value) -- in that case any java.util.Date will be matched only by the fields it has ignoring any "lesser" time units (like hours and minutes). Use st like:
Code:
<property name="validDate" type="date">
<column name="valid_date" not-null="true"/>
</property>
3. JFYI -- the "yyyy-mm-dd" is output of java.sql.Date, look for the db column type definition -- it could be only date and or date and time, you can't recognize it from this string output