From: <hib...@li...> - 2006-04-28 15:45:11
|
Author: epbernard Date: 2006-04-28 11:44:49 -0400 (Fri, 28 Apr 2006) New Revision: 9832 Modified: trunk/HibernateExt/metadata/src/java/org/hibernate/reflection/java/EJB3OverridenAnnotationReader.java trunk/HibernateExt/metadata/src/test/org/hibernate/test/annotations/collectionelement/CollectionElementTest.java Log: ANN-333 shown @Join* when @CollectionOfElements is used Modified: trunk/HibernateExt/metadata/src/java/org/hibernate/reflection/java/EJB3OverridenAnnotationReader.java =================================================================== --- trunk/HibernateExt/metadata/src/java/org/hibernate/reflection/java/EJB3OverridenAnnotationReader.java 2006-04-28 15:32:01 UTC (rev 9831) +++ trunk/HibernateExt/metadata/src/java/org/hibernate/reflection/java/EJB3OverridenAnnotationReader.java 2006-04-28 15:44:49 UTC (rev 9832) @@ -77,6 +77,7 @@ import org.hibernate.annotationfactory.AnnotationFactory; import org.hibernate.annotations.AccessType; import org.hibernate.annotations.Columns; +import org.hibernate.annotations.CollectionOfElements; import org.hibernate.reflection.Filter; import org.hibernate.reflection.java.xml.XMLContext; import org.hibernate.util.ReflectHelper; @@ -479,6 +480,40 @@ annotation = super.getAnnotation( Columns.class ); if ( annotation != null ) annotationList.add( annotation ); } + else if ( super.isAnnotationPresent( CollectionOfElements.class ) ) { + annotation = overridesDefaultsInJoinTable( defaults ); + if ( annotation != null ) annotationList.add( annotation ); + annotation = super.getAnnotation( JoinColumn.class ); + if ( annotation != null ) annotationList.add( annotation ); + annotation = super.getAnnotation( JoinColumns.class ); + if ( annotation != null ) annotationList.add( annotation ); + annotation = super.getAnnotation( PrimaryKeyJoinColumn.class ); + if ( annotation != null ) annotationList.add( annotation ); + annotation = super.getAnnotation( PrimaryKeyJoinColumns.class ); + if ( annotation != null ) annotationList.add( annotation ); + annotation = super.getAnnotation( MapKey.class ); + if ( annotation != null ) annotationList.add( annotation ); + annotation = super.getAnnotation( OrderBy.class ); + if ( annotation != null ) annotationList.add( annotation ); + annotation = super.getAnnotation( AttributeOverride.class ); + if ( annotation != null ) annotationList.add( annotation ); + annotation = super.getAnnotation( AttributeOverrides.class ); + if ( annotation != null ) annotationList.add( annotation ); + annotation = super.getAnnotation( AssociationOverride.class ); + if ( annotation != null ) annotationList.add( annotation ); + annotation = super.getAnnotation( AssociationOverrides.class ); + if ( annotation != null ) annotationList.add( annotation ); + annotation = super.getAnnotation( Lob.class ); + if ( annotation != null ) annotationList.add( annotation ); + annotation = super.getAnnotation( Enumerated.class ); + if ( annotation != null ) annotationList.add( annotation ); + annotation = super.getAnnotation( Temporal.class ); + if ( annotation != null ) annotationList.add( annotation ); + annotation = super.getAnnotation( Column.class ); + if ( annotation != null ) annotationList.add( annotation ); + annotation = super.getAnnotation( Columns.class ); + if ( annotation != null ) annotationList.add( annotation ); + } } } Modified: trunk/HibernateExt/metadata/src/test/org/hibernate/test/annotations/collectionelement/CollectionElementTest.java =================================================================== --- trunk/HibernateExt/metadata/src/test/org/hibernate/test/annotations/collectionelement/CollectionElementTest.java 2006-04-28 15:32:01 UTC (rev 9831) +++ trunk/HibernateExt/metadata/src/test/org/hibernate/test/annotations/collectionelement/CollectionElementTest.java 2006-04-28 15:44:49 UTC (rev 9832) @@ -12,6 +12,10 @@ public class CollectionElementTest extends TestCase { public void testSimpleElement() throws Exception { + assertEquals( + "BoyFavoriteNumbers", + getCfg().getCollectionMapping( Boy.class.getName() + '.' + "favoriteNumbers" ).getCollectionTable().getName() + ); Session s = openSession(); s.getTransaction().begin(); Boy boy = new Boy(); |