Skip to content

Commit 3a07c28

Browse files
amkadbrmeyer
authored andcommitted
Fixed @Any and @ManyToAny support in overridden JPA annotation reader HHH-4261
1 parent 95d113f commit 3a07c28

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

hibernate-core/src/main/java/org/hibernate/cfg/annotations/reflection/JPAOverriddenAnnotationReader.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,8 +122,10 @@
122122
import org.jboss.logging.Logger;
123123

124124
import org.hibernate.AnnotationException;
125+
import org.hibernate.annotations.Any;
125126
import org.hibernate.annotations.Cascade;
126127
import org.hibernate.annotations.Columns;
128+
import org.hibernate.annotations.ManyToAny;
127129
import org.hibernate.annotations.common.annotationfactory.AnnotationDescriptor;
128130
import org.hibernate.annotations.common.annotationfactory.AnnotationFactory;
129131
import org.hibernate.annotations.common.reflection.AnnotationReader;
@@ -205,6 +207,8 @@ public boolean returnTransient() {
205207
annotationToXml.put( OneToOne.class, "one-to-one" );
206208
annotationToXml.put( OneToMany.class, "one-to-many" );
207209
annotationToXml.put( ManyToMany.class, "many-to-many" );
210+
annotationToXml.put( Any.class, "any" );
211+
annotationToXml.put( ManyToAny.class, "many-to-any" );
208212
annotationToXml.put( JoinTable.class, "join-table" );
209213
annotationToXml.put( JoinColumn.class, "join-column" );
210214
annotationToXml.put( JoinColumns.class, "join-column" );
@@ -396,6 +400,8 @@ else if ( className != null ) { //&& propertyName != null ) { //always true but
396400
getAssociation( OneToOne.class, annotationList, defaults );
397401
getAssociation( OneToMany.class, annotationList, defaults );
398402
getAssociation( ManyToMany.class, annotationList, defaults );
403+
getAssociation( Any.class, annotationList, defaults );
404+
getAssociation( ManyToAny.class, annotationList, defaults );
399405
getElementCollection( annotationList, defaults );
400406
addIfNotNull( annotationList, getSequenceGenerator( elementsForProperty, defaults ) );
401407
addIfNotNull( annotationList, getTableGenerator( elementsForProperty, defaults ) );

0 commit comments

Comments
 (0)