code: public void populateRelationshipProperties(EntityMetadata entityMetadata, EntityMetadata targetNodeMetadata,
              Relationship relationship, Object relationshipObj)
      {
          MetamodelImpl metaModel = (MetamodelImpl) kunderaMetadata.getApplicationMetadata().getMetamodel(
                  entityMetadata.getPersistenceUnit());
          EntityType entityType = metaModel.entity(relationshipObj.getClass());
  
          Set<Attribute> attributes = entityType.getSingularAttributes();
          for (Attribute attribute : attributes)
          {
              Field f = (Field) attribute.getJavaMember();
              if (!f.getType().equals(entityMetadata.getEntityClazz())
                      && !f.getType().equals(targetNodeMetadata.getEntityClazz()))
              {
                  EntityMetadata relMetadata = KunderaMetadataManager.getEntityMetadata(kunderaMetadata,
                          relationshipObj.getClass());
                  String columnName = ((AbstractAttribute) attribute).getJPAColumnName();
                  if (metaModel.isEmbeddable(relMetadata.getIdAttribute().getBindableJavaType())
                          && ((SingularAttribute) attribute).isId())
                  {
                      // Populate Embedded attribute value into relationship
                      Object id = PropertyAccessorHelper.getId(relationshipObj, relMetadata);
                      Object serializedIdValue = serializeIdAttributeValue(relMetadata, metaModel, id);
                      relationship.setProperty(columnName, serializedIdValue);
  
                      // Populate attributes of embedded fields into relationship
                      Set<Attribute> embeddableAttributes = metaModel.embeddable(
                              relMetadata.getIdAttribute().getBindableJavaType()).getSingularAttributes();
                      for (Attribute embeddableAttribute : embeddableAttributes)
                      {
                          String embeddedColumn = ((AbstractAttribute) embeddableAttribute).getJPAColumnName();
                          if (embeddedColumn == null)
                              embeddedColumn = embeddableAttribute.getName();
                          Object value = PropertyAccessorHelper
                                  .getObject(id, (Field) embeddableAttribute.getJavaMember());
  
                          if (value != null)
                              relationship.setProperty(embeddedColumn, value);
                      }
                  }
                  else
                  {
                      Object value = PropertyAccessorHelper.getObject(relationshipObj, f);
                      relationship.setProperty(columnName, toNeo4JProperty(value));
                  }
  
              }
          }
  
      }
docs: Populates a {@link Relationship} with attributes of a given relationship
  entity object <code>relationshipObj</code>
  
  @param entityMetadata
  @param targetNodeMetadata
  @param relationship
  @param relationshipObj