code: private JsonObject iterateAndPopulateJsonObject(Object entity, Iterator<Attribute> iterator, String tableName)
      {
          JsonObject obj = JsonObject.create();
          while (iterator.hasNext())
          {
              Attribute attribute = iterator.next();
              Field field = (Field) attribute.getJavaMember();
              Object value = PropertyAccessorHelper.getObject(entity, field);
  
              obj.put(((AbstractAttribute) attribute).getJPAColumnName(), value);
          }
          obj.put(CouchbaseConstants.KUNDERA_ENTITY, tableName);
          return obj;
      }
docs: Iterate and populate json object.
  
  @param entity
  the entity
  @param iterator
  the iterator
  @return the json object