code: private MapObject iterateAndPopulateRmap(Object entity, MetamodelImpl metaModel, Iterator<Attribute> iterator)
      {
          MapObject map = r.hashMap();
          while (iterator.hasNext())
          {
              Attribute attribute = iterator.next();
              Field field = (Field) attribute.getJavaMember();
              Object value = PropertyAccessorHelper.getObject(entity, field);
              if (field.isAnnotationPresent(Id.class))
              {
                  map.with(ID, value);
              }
              else
              {
                  map.with(((AbstractAttribute) attribute).getJPAColumnName(), value);
              }
          }
          return map;
      }
docs: Iterate and populate rmap.
  
  @param entity
  the entity
  @param metaModel
  the meta model
  @param iterator
  the iterator
  @return the map object