From: <hib...@li...> - 2006-04-30 16:34:14
|
Author: epbernard Date: 2006-04-30 12:34:04 -0400 (Sun, 30 Apr 2006) New Revision: 9835 Modified: trunk/HibernateExt/metadata/src/java/org/hibernate/cfg/BinderHelper.java Log: ANN-307 exclude noop and embedded property accessor when finding the appropriate property per columns Modified: trunk/HibernateExt/metadata/src/java/org/hibernate/cfg/BinderHelper.java =================================================================== --- trunk/HibernateExt/metadata/src/java/org/hibernate/cfg/BinderHelper.java 2006-04-30 04:21:48 UTC (rev 9834) +++ trunk/HibernateExt/metadata/src/java/org/hibernate/cfg/BinderHelper.java 2006-04-30 16:34:04 UTC (rev 9835) @@ -188,7 +188,7 @@ ExtendedMappings mappings ) { Map<Column, Set<Property>> columnsToProperty = new HashMap<Column, Set<Property>>(); - List<Column> orderedColumns = new ArrayList<Column>(); + List<Column> orderedColumns = new ArrayList<Column>( columns.length ); Table referencedTable = null; if ( columnOwner instanceof PersistentClass ) { referencedTable = ( (PersistentClass) columnOwner ).getTable(); @@ -200,9 +200,10 @@ throw new AssertionFailure( columnOwner == null ? "columnOwner is null" : - "columnOwner neither PersistentClass not Join: " + columnOwner.getClass() + "columnOwner neither PersistentClass nor Join: " + columnOwner.getClass() ); } + //build the list of column names for ( int index = 0; index < columns.length ; index++ ) { Column column = new Column( mappings.getPhysicalColumnName( columns[index].getReferencedColumn(), referencedTable ) @@ -215,6 +216,10 @@ ( (Join) columnOwner ).getPropertyIterator(); while ( it.hasNext() ) { Property property = (Property) it.next(); + if ( "noop".equals( property.getPropertyAccessorName() ) + || "embedded".equals( property.getPropertyAccessorName() ) ) { + continue; + } Iterator columnIt = property.getColumnIterator(); while ( columnIt.hasNext() ) { Column column = (Column) columnIt.next(); |