I've got a named query which has a date comparison in the where clause ( x.statusdate <= :systemDate).
The systemDate is a named parameter and is a java.util.Date.
The x.statusdate is a java.util.Date and is mapped with type=java.util.Date in the hbm file.
So, the query needs to select entries of which the statusdate (up to the millisecond precision !!!) is smaller than or equal than the current system time (this is parameter 1 below).
The question I have is whether the value shown (see below) for the binding is actually the value that will be used in the query to do the comparison ?
If so, then there's a problem because the shown value doesn't contain any milliseconds.
If not, then I guess it's a bug in the trace formatting of the date value ?
Regarding the resultset. In there I can see when debugging that it contains my resulting objects and the x.statusDate is of type java.util.Timestamp and contains milliseconds. However the trace output (see below) seems to truncate the milliseconds ?
Again, is this an error in the trace output's formatting, or is the returned value indeed truncated and are the milliseconds lost ?
So bottomline the question is whether my query will only select those entries that are smaller than or equal to the given system date taking into account milliseconds ?
Code:
[TRACE] org.hibernate.jdbc.AbstractBatcher - preparing statement
[TRACE] org.hibernate.type.TimestampType - binding '2010-11-09 12:50:18' to parameter: 1
[DEBUG] org.hibernate.jdbc.AbstractBatcher - about to open ResultSet (open ResultSets: 0, globally: 0)
...
[TRACE] org.hibernate.type.TimestampType - returning '2010-11-09 10:57:34' as column: CREATIE10_4_
...
Thanks,
EDH