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 ; }
Iterate and populate json object .