code: public Map<String, Object> createRelationshipProperties(EntityMetadata entityMetadata,
              EntityMetadata targetEntityMetadata, Object relationshipEntity)
      {
          MetamodelImpl metaModel = (MetamodelImpl) kunderaMetadata.getApplicationMetadata().getMetamodel(
                  entityMetadata.getPersistenceUnit());
          EntityType entityType = metaModel.entity(relationshipEntity.getClass());
          Map<String, Object> relationshipProperties = new HashMap<String, Object>();
  
          Set<Attribute> attributes = entityType.getSingularAttributes();
          for (Attribute attribute : attributes)
          {
              Field f = (Field) attribute.getJavaMember();
              if (!f.getType().equals(entityMetadata.getEntityClazz())
                      && !f.getType().equals(targetEntityMetadata.getEntityClazz()))
              {
                  String relPropertyName = ((AbstractAttribute) attribute).getJPAColumnName();
                  Object value = PropertyAccessorHelper.getObject(relationshipEntity, f);
                  relationshipProperties.put(relPropertyName, toNeo4JProperty(value));
              }
          }
          return relationshipProperties;
      }
docs: Creates a Map containing all properties (and their values) for a given
  relationship entity
  
  @param entityMetadata
  @param targetEntityMetadata
  @param relationshipProperties
  @param relationshipEntity