I'm seeing a weird issue with Hibernate 2.1.4/Oracle 10.
I have a java.util.Date mapped to an Oracle DATE.
In a unit test I have, I create an object, then persist to database. I then load the associated record into another object, and compare each attribute for equality.
The date, as you might expect, has millisecond granularity that a java.util.Date doesn't have, so the compare fails. But, for fun, I altered my assertion message to also print out the class name of the attribute... So, for the object that I saved to DB, the attribute in question is java.util.Date. No surprise. But, for the object I load back, it's a java.sql.Timestamp?!?
User originalUser = new User();
// populate attributes in originalUser
dao.save( originalUser );
User reloadedUser = dao.load ( anId );
// originalUser.dateColumn.class.toString() !=
// reloadedUser.dateColumn.class.toString() ?!?
I appreciate dates not comparing due to mllisecond rounding, etc., but I now have a User object with a different attribute type than another User object. That seems very disconcerting...
_________________ Bryan Headley
The Ticket Reserve
|