Hi!
I just started to study hibernate, so possibly my question rather silly.
I have:
(it's Date.toSring() output)
start date: Sun Dec 19 00:00:00 MSK 2005
end date: Mon Dec 19 23:59:59 MSK 2005
Query String:
select e.body, e.date, e.number from MessageEntry e
where e.date <= :endDate AND e.date >= :startDate
This query with dates does not match entries with date
2005-12-19 19:46:43.0
If I use this dates
start date: Sun Dec 19 00:00:00 MSK 2005
end date: Mon Dec 20 23:59:59 MSK 2005
then it matches messages with date
2005-12-19 19:46:43.0
Can anybody explain, why I can't get messages in first case?
Where possible problem?
Maybe .hbm.xml incorrect, and need to change something?
<property name="date" column="message_date" not-null = "true" type="timestamp" />
(in DB table field type is timestamp)
Thanks.
Hibernate version: 3.0
|