code: private void addRelationIntoMetadata(Class<?> entityClass, Field relationField, EntityMetadata metadata)
      {
          RelationMetadataProcessor relProcessor = null;
          try
          {
              relProcessor = RelationMetadataProcessorFactory
                      .getRelationMetadataProcessor(relationField, kunderaMetadata);
  
              this.factory.validate(relationField, new RelationAttributeRule());
  
              relProcessor = RelationMetadataProcessorFactory
                      .getRelationMetadataProcessor(relationField, kunderaMetadata);
  
              if (relProcessor != null)
              {
                  relProcessor.addRelationIntoMetadata(relationField, metadata);
              }
  
          }
          catch (PersistenceException pe)
          {
              throw new MetamodelLoaderException("Error with relationship in @Entity(" + entityClass + "."
                      + relationField.getName() + "), reason: " + pe);
          }
  
      }
docs: Adds relationship info into metadata for a given field
  <code>relationField</code>.
  
  @param entityClass
  the entity class
  @param relationField
  the relation field
  @param metadata
  the metadata