code: @Override
      public void addRelationIntoMetadata(Field relationField, EntityMetadata metadata)
      {
          // taking field's type as foreign entity, ignoring "targetEntity"
          Class<?> targetEntity = relationField.getType();
  
          ManyToOne ann = relationField.getAnnotation(ManyToOne.class);
          Relation relation = new Relation(relationField, targetEntity, null, ann.fetch(), Arrays.asList(ann.cascade()),
                  ann.optional(), null, // mappedBy is null
                  Relation.ForeignKey.MANY_TO_ONE);
  
          boolean isJoinedByFK = relationField.isAnnotationPresent(JoinColumn.class);
  
          if (relationField.isAnnotationPresent(AssociationOverride.class))
          {
              AssociationOverride annotation = relationField.getAnnotation(AssociationOverride.class);
              JoinColumn[] joinColumns = annotation.joinColumns();
  
              relation.setJoinColumnName(joinColumns[0].name());
  
          }
          else if (isJoinedByFK)
          {
              JoinColumn joinColumnAnn = relationField.getAnnotation(JoinColumn.class);
              relation.setJoinColumnName(StringUtils.isBlank(joinColumnAnn.name()) ? relationField.getName()
                      : joinColumnAnn.name());
          }
          else
          {
              relation.setJoinColumnName(relationField.getName());
          }
  
          relation.setBiDirectionalField(metadata.getEntityClazz());
          metadata.addRelation(relationField.getName(), relation);
  
      }
docs: /*
  (non-Javadoc)
  
  @see
  com.impetus.kundera.metadata.processor.relation.RelationMetadataProcessor
  #addRelationIntoMetadata(java.lang.reflect.Field,
  com.impetus.kundera.metadata.model.EntityMetadata)