Hi,
I've got the same kind of problem, but in my case the query return a sub class of java.sql.Timestamp (Sybase driver). I also use Hibernate 2.1.4.
So, when I compare this date with a java.util.Date with date1.equals(date2) the test return false, even if the milliseconds are the same (the equals method test if the dates are of the same Class).
To avoid this, I've changed my setters like this :
Code:
public void setDate(Date date) {
if (date instanceof Timestamp) {
this.date = new Date(date.getTime());
} else {
this.date = date;
}
}
I dont like it, but I see no other way.
So, if anyone knows how to force Hibernate to use java.util.Date instead of any of its subclass, please let me know.
Thanks
Jerome