From: <hib...@li...> - 2006-04-19 03:56:50
|
Author: epbernard Date: 2006-04-18 23:56:49 -0400 (Tue, 18 Apr 2006) New Revision: 9769 Modified: trunk/HibernateExt/metadata/src/java/org/hibernate/cfg/annotations/MapBinder.java Log: ANN-1 <Element, Element>, <Element, @Component> <Element, Entity> work Modified: trunk/HibernateExt/metadata/src/java/org/hibernate/cfg/annotations/MapBinder.java =================================================================== --- trunk/HibernateExt/metadata/src/java/org/hibernate/cfg/annotations/MapBinder.java 2006-04-19 03:37:31 UTC (rev 9768) +++ trunk/HibernateExt/metadata/src/java/org/hibernate/cfg/annotations/MapBinder.java 2006-04-19 03:56:49 UTC (rev 9769) @@ -95,10 +95,10 @@ //TODO ugly copy/pastle from CollectionBinder.bindManyToManySecondPass String mapKeyType = property.getMapKey().getName(); PersistentClass collectionEntity = (PersistentClass) persistentClasses.get( mapKeyType ); - boolean isCollectionOfEntities = collectionEntity != null; + boolean isIndexOfEntities = collectionEntity != null; ManyToOne element = null; org.hibernate.mapping.Map mapValue = (org.hibernate.mapping.Map) this.collection; - if ( isCollectionOfEntities ) { + if ( isIndexOfEntities ) { element = new ManyToOne( mapValue.getCollectionTable() ); mapValue.setIndex( element ); @@ -187,7 +187,7 @@ column.setImplicit( false ); column.setNullable( false ); column.setLength( Ejb3Column.DEFAULT_COLUMN_LENGTH ); - column.setLogicalColumnName( Collection.DEFAULT_KEY_COLUMN_NAME ); //TODO inject column name here + column.setLogicalColumnName( Collection.DEFAULT_KEY_COLUMN_NAME ); //TODO create an EMPTY_JOINS collection column.setJoins( new HashMap<String, Join>() ); column.setMappings( mappings ); @@ -203,7 +203,10 @@ mapValue.setIndex( elementBinder.make() ); } } - + //FIXME pass the Index Entity JoinColumns + if ( isIndexOfEntities ) { + //bindManytoManyInverseFk( collectionEntity, indexJoinColumns, element, unique, mappings ); + } } } |