Hoi,
I wrote a simple custom UserType for exactly this problem that
translates the java.sql.Timestamp into Java Dates on deserialization
from the database, it's very simple:
public class DateTimeType extends TimestampType {
public Object get(ResultSet rs, String name) throws SQLException {
Timestamp timestamp = (Timestamp) super.get(rs, name);
if (timestamp == null) {
return null;
}
return new java.util.Date(timestamp.getTime());
}
}
Jut put the above class into your server side project and use it as
type in the hibernate mapping files:
<property name="registered"
type="com.company.some.pagacke.server.DateTimeType"
column="registered_on" />
Hope this helps!
Aragos