HHH-18868 Array annotated with one of @ManyToMany, @OneToMany, or @ElementCollection should be represented with ListAttribute, not SingularAttribute
This commit is contained in:
parent
212d4b676e
commit
a38a300a32
|
@ -27,6 +27,7 @@ import javax.tools.Diagnostic;
|
|||
import java.util.List;
|
||||
|
||||
import static org.hibernate.processor.util.Constants.ELEMENT_COLLECTION;
|
||||
import static org.hibernate.processor.util.Constants.LIST_ATTRIBUTE;
|
||||
import static org.hibernate.processor.util.Constants.MANY_TO_ANY;
|
||||
import static org.hibernate.processor.util.Constants.MANY_TO_MANY;
|
||||
import static org.hibernate.processor.util.Constants.MAP_KEY_CLASS;
|
||||
|
@ -70,8 +71,14 @@ public class MetaAttributeGenerationVisitor extends SimpleTypeVisitor8<@Nullable
|
|||
|
||||
@Override
|
||||
public @Nullable AnnotationMetaAttribute visitArray(ArrayType arrayType, Element element) {
|
||||
if ( hasAnnotation( element, MANY_TO_MANY, ONE_TO_MANY, ELEMENT_COLLECTION ) ) {
|
||||
return new AnnotationMetaCollection( entity, element, LIST_ATTRIBUTE,
|
||||
toTypeString(arrayType.getComponentType()) );
|
||||
}
|
||||
else {
|
||||
return new AnnotationMetaSingleAttribute( entity, element, toArrayTypeString( arrayType, context ) );
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public @Nullable AnnotationMetaAttribute visitTypeVariable(TypeVariable typeVariable, Element element) {
|
||||
|
|
Loading…
Reference in New Issue