| When using compile-time enhancement, PluralAttribute.getPersistentAttributeType() returns PersistentAttributeType.ONE_TO_MANY for all plural (collection) associations. The problem, maybe, is inside:
public static boolean isManyToMany(Member member) {
if ( Field.class.isInstance( member ) ) {
return ( (Field) member ).getAnnotation( ManyToMany.class ) != null;
}
else if ( Method.class.isInstance( member ) ) {
return ( (Method) member ).getAnnotation( ManyToMany.class ) != null;
}
return false;
}
where Field.getAnnotation(ManyToMany.class) is called on the enhanced/generated field which doesn't have the annotation. It should be called on the original field. |