Right now, Hibernate will increment an entity version number whenever a property of the entity is modified and the entity is being saved. This is true for modifications of simple properties, components, many-to-one relationships and even collections of value types and collections for one-to-many and many-to-many associations (thats basically all modifications).
This model is certainly correct from an object-oriented point of view: Modify the "object", increment version. However, it is often not the best from the POV of the relational model: Adding an entity-reference of B to a collection of Bs in the A doesn't actually change any of the values in the table row of A, just some foreign key in the table of B (or in a link table for many-to-many. Therefore, the _row_ of the A doesn't need a new version. I've been thinking about this behavior in the past and I've been having problems with that right now in an application that has a complex versioning/history/revision model. Others apparently also think that this should be an option that can be switched at the class mapping level. I'd like to implement this in 2.1 branch, opinions? -- Christian Bauer [EMAIL PROTECTED] http://www.hibernate.org/ ------------------------------------------------------- This SF.Net email is sponsored by: IBM Linux Tutorials Free Linux tutorial presented by Daniel Robbins, President and CEO of GenToo technologies. Learn everything from fundamentals to system administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click _______________________________________________ hibernate-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/hibernate-devel