code: private MapObject populateRmap(EntityMetadata entityMetadata, Object entity)
      {
          MetamodelImpl metaModel = (MetamodelImpl) kunderaMetadata.getApplicationMetadata()
                  .getMetamodel(entityMetadata.getPersistenceUnit());
          Class entityClazz = entityMetadata.getEntityClazz();
          EntityType entityType = metaModel.entity(entityClazz);
          Set<Attribute> attributes = entityType.getAttributes();
          Iterator<Attribute> iterator = attributes.iterator();
          return iterateAndPopulateRmap(entity, metaModel, iterator);
      }
docs: Populate rmap.
  
  @param entityMetadata
  the entity metadata
  @param entity
  the entity
  @return the map object