private Boolean validateManyToOne(Field relationField, Annotation annotate)
    {
        // taking field's type as foreign entity, ignoring "targetEntity"

        Class<?> targetEntity = relationField.getType();

        boolean isJoinedByTable = relationField.isAnnotationPresent(JoinTable.class);
          
        if (relationField.isAnnotationPresent(AssociationOverride.class))
        {
            AssociationOverride annotation = relationField.getAnnotation(AssociationOverride.class);
            JoinColumn[] joinColumns = annotation.joinColumns();
            
            //validate if more than one  join column is defined
            validateJoinColumns(joinColumns);

            JoinTable joinTable = annotation.joinTable();
            //validate if join table is null
            onJoinTable(joinTable);
        }
        // join table not valid for Many to one check
        else if (isJoinedByTable)
        { 
            throw new UnsupportedOperationException("@JoinTable not supported for many to one association");
        }

        return true;
    }
private Boolean validateManyToOne ( Field relationField , Annotation annotate ) { Class < ? > targetEntity = relationField . getType ( ) ; boolean isJoinedByTable = relationField . isAnnotationPresent ( JoinTable . class ) ; if ( relationField . isAnnotationPresent ( AssociationOverride . class ) ) { AssociationOverride annotation = relationField . getAnnotation ( AssociationOverride . class ) ; JoinColumn [ ] joinColumns = annotation . joinColumns ( ) ; validateJoinColumns ( joinColumns ) ; JoinTable joinTable = annotation . joinTable ( ) ; onJoinTable ( joinTable ) ; } else if ( isJoinedByTable ) { throw new UnsupportedOperationException ( "@JoinTable not supported for many to one association" ) ; } return true ; }
@param relationField
@param annotate
@return