Hibernate version: 3.0
Name and version of the database you are using: Oracle 10g
I have a problem with Date/Timestamp fields. My POJO class has an attribute of type java.util.Date. In the Oracle database the type of the fiel is DATE.
So, in my selects Hibernate returns Timestamp type from the database, but I really need use java.util.Date in this class, because I use it in a webservice, and Timestamp don't have a empty constructor. So in my set of this attribute, I do like this:
Code:
public void setTime(Date time) {
if (time != null)
this.time = new Date(time.getTime());
}
Then hibernate detects that the value was changed and do an update into database.
Is there any way to Hibernate returns the java.util.Date type from Oracle db ? Or may I disable this automatic detects from Hibernate? If I override the "equals()" method of my POJO class could I fix this ?
Thanks in advance.
[]
Anderson Araujo