+1  A: 

nullSafeSet() is invoked both when the entity is being saved / updated and when query parameter has to be set.

Your problem lies with "updateToNow" flag; if it's set to true in your mapping for given entity, you'll always be overwriting the values with the current timestamp. Remove that and you'll be fine.

If you're always setting the timestamp to current (for given column), consider doing so in the database and mapping your property as "generated" instead.

ChssPly76
Yes this would seem to be the way to do it but using Derby you would need to use CURRENT_TIMESTAMP or similar for the field. Derby doesn't support CURRENT_TIMESTAMP for a specific time zone (UTC for the database), only for the VM's current timezone, which in my case is/has to be different than UTC.
Nathan Johns
Well, your other option is to do it in the DAO when saving or in the appropriate listener (`@PrePersist` if you're using JPA / Hibernate Entity Manager).
ChssPly76
For the moment I have just done the updating in the DAO. I may be able to revisit a better solution later. I did see @PrePersist while searching on Google and seems to be a possible solution but I am not using annotations at the moment or JPA / HibernateEntityManager and would take to long to retrofit for the current requirements.
Nathan Johns
You can do it in core Hibernate using listeners as well: http://docs.jboss.org/hibernate/stable/core/reference/en/html/events.html#objectstate-events
ChssPly76