I'm adding a version column to some of my tables and I was wondering:
1- whether the column should be nullable or not
2- whether it should have a default value or not
The hibernate docs say the following:
Quote:
A version or timestamp property should never be null for a detached instance. Hibernate will detect any instance with a null version or timestamp as transient, irrespective of what other unsaved-value strategies are specified. Declaring a nullable version or timestamp property is an easy way to avoid problems with transitive reattachment in Hibernate. It is especially useful for people using assigned identifiers or composite keys.
(from
http://docs.jboss.org/hibernate/stable/ ... pping.html)
I don't really understand the last part. Can someone shed some light on this ?