From: <hib...@li...> - 2006-08-06 16:11:29
|
Author: ste...@jb... Date: 2006-08-06 12:11:24 -0400 (Sun, 06 Aug 2006) New Revision: 10229 Modified: trunk/Hibernate3/src/org/hibernate/tuple/entity/EntityMetamodel.java trunk/Hibernate3/test/org/hibernate/test/legacy/Glarch.hbm.xml Log: HHH-1980 : disallow combination of <version/> and optimistic-lock Modified: trunk/Hibernate3/src/org/hibernate/tuple/entity/EntityMetamodel.java =================================================================== --- trunk/Hibernate3/src/org/hibernate/tuple/entity/EntityMetamodel.java 2006-08-06 09:17:53 UTC (rev 10228) +++ trunk/Hibernate3/src/org/hibernate/tuple/entity/EntityMetamodel.java 2006-08-06 16:11:24 UTC (rev 10229) @@ -253,6 +253,9 @@ if ( optimisticLockMode > Versioning.OPTIMISTIC_LOCK_VERSION && !dynamicUpdate ) { throw new MappingException( "optimistic-lock setting requires dynamic-update=\"true\": " + name ); } + if ( versionPropertyIndex != NO_VERSION_INDX && optimisticLockMode > Versioning.OPTIMISTIC_LOCK_VERSION ) { + throw new MappingException( "version and optimistic-lock are not a valid combination : " + name ); + } hasCollections = foundCollection; hasMutableProperties = foundMutable; Modified: trunk/Hibernate3/test/org/hibernate/test/legacy/Glarch.hbm.xml =================================================================== --- trunk/Hibernate3/test/org/hibernate/test/legacy/Glarch.hbm.xml 2006-08-06 09:17:53 UTC (rev 10228) +++ trunk/Hibernate3/test/org/hibernate/test/legacy/Glarch.hbm.xml 2006-08-06 16:11:24 UTC (rev 10229) @@ -7,8 +7,7 @@ <class name="Glarch" table="`glarchez`" proxy="GlarchProxy" - dynamic-update="true" - optimistic-lock="dirty"> + dynamic-update="true"> <!--cache--> <id type="string" column="tha_key" length="32"> |