[hibernate-commits] Hibernate SVN: r10319 - branches/Branch_3_2/Hibernate3/src/org/hibernate/mapping

hibernate-commits at lists.jboss.org hibernate-commits at lists.jboss.org
Wed Aug 23 17:57:11 EDT 2006


Author: epbernard
Date: 2006-08-23 17:57:10 -0400 (Wed, 23 Aug 2006)
New Revision: 10319

Modified:
   branches/Branch_3_2/Hibernate3/src/org/hibernate/mapping/PersistentClass.java
Log:
ANN-381 add identifierProperty to getProperty and getRecursiveProperty

Modified: branches/Branch_3_2/Hibernate3/src/org/hibernate/mapping/PersistentClass.java
===================================================================
--- branches/Branch_3_2/Hibernate3/src/org/hibernate/mapping/PersistentClass.java	2006-08-23 13:36:35 UTC (rev 10318)
+++ branches/Branch_3_2/Hibernate3/src/org/hibernate/mapping/PersistentClass.java	2006-08-23 21:57:10 UTC (rev 10319)
@@ -349,7 +349,14 @@
 			while ( st.hasMoreElements() ) {
 				String element = (String) st.nextElement();
 				if (property == null) {
-					property = getProperty( element, iter );
+					Property identifierProperty = getIdentifierProperty();
+					if ( identifierProperty != null
+							&& identifierProperty.getName().equals( StringHelper.root(element) ) ) {
+						property = identifierProperty;
+					}
+					else {
+						property = getProperty( element, iter );
+					}
 				}
 				else {
 					//flat recursive algorithm
@@ -379,7 +386,15 @@
 
 	public Property getProperty(String propertyName) throws MappingException {
 		Iterator iter = getPropertyClosureIterator();
-		return getProperty( propertyName, iter );
+		Property identifierProperty = getIdentifierProperty();
+		if ( identifierProperty != null
+				&& identifierProperty.getName().equals( StringHelper.root(propertyName) )
+				) {
+			return identifierProperty;
+		}
+		else {
+			return getProperty( propertyName, iter );
+		}
 	}
 
 	abstract public int getOptimisticLockMode();




More information about the hibernate-commits mailing list