private static void validateManyToManyAnnotation(final Method method) { final ManyToMany manyToMany = method.getAnnotation(ManyToMany.class); if (manyToMany != null) { final Class<? extends RawEntity<?>> throughType = manyToMany.value(); final String reverse = manyToMany.reverse(); if (reverse.length() != 0) { try { throughType.getMethod(reverse); } catch (final NoSuchMethodException exception) { throw new IllegalArgumentException(method + " has a ManyToMany annotation with an invalid reverse element value. It must be the name of the corresponding getter method on the joining entity.", exception); } } if (manyToMany.through().length() != 0) { try { throughType.getMethod(manyToMany.through()); } catch (final NoSuchMethodException exception) { throw new IllegalArgumentException(method + " has a ManyToMany annotation with an invalid through element value. It must be the name of the getter method on the joining entity that refers to the remote entities.", exception); } } } }
private static void validateManyToManyAnnotation(final Method method) { final ManyToMany manyToMany = method.getAnnotation(ManyToMany.class); if (manyToMany != null) { final Class<? extends RawEntity<?>> throughType = manyToMany.value(); final String reverse = manyToMany.reverse(); if (reverse.length() != 0) { try { throughType.getMethod(reverse); } catch (final NoSuchMethodException exception) { throw new IllegalArgumentException(method + " has a ManyToMany annotation with an invalid reverse element value. It must be the name of the corresponding getter method on the joining entity.", exception); } } if (manyToMany.through().length() != 0) { try { throughType.getMethod(manyToMany.through()); } catch (final NoSuchMethodException exception) { throw new IllegalArgumentException(method + " has a ManyToMany annotation with an invalid through element value. It must be the name of the getter method on the joining entity that refers to the remote entities.", exception); } } } }
if (manyToManyAnnotation.reverse().isEmpty() || manyToManyAnnotation.through().isEmpty()) { ret = legacyFetchManyToMany((RawEntity<K>) proxy, method, manyToManyAnnotation); } else {
if (manyToManyAnnotation.reverse().isEmpty() || manyToManyAnnotation.through().isEmpty()) { ret = legacyFetchManyToMany((RawEntity<K>) proxy, method, manyToManyAnnotation); } else {
final String whereClause = Common.where(annotation, getFieldNameConverter()); final Preload preloadAnnotation = (Preload) remoteType.getAnnotation(Preload.class); final Method reverseMethod = throughType.getMethod(annotation.reverse()); final Method throughMethod = throughType.getMethod(annotation.through()); final String reversePolymorphicTypeFieldName = getAttributeTypeFromMethod(reverseMethod).isAnnotationPresent(Polymorphic.class) ? getFieldNameConverter().getPolyTypeName(reverseMethod) : null;
final String whereClause = Common.where(annotation, getFieldNameConverter()); final Preload preloadAnnotation = (Preload) remoteType.getAnnotation(Preload.class); final Method reverseMethod = throughType.getMethod(annotation.reverse()); final Method throughMethod = throughType.getMethod(annotation.through()); final String reversePolymorphicTypeFieldName = getAttributeTypeFromMethod(reverseMethod).isAnnotationPresent(Polymorphic.class) ? getFieldNameConverter().getPolyTypeName(reverseMethod) : null;