Skip to content

Commit

Permalink
Fix .toJSON() with embedded lists in SQL
Browse files Browse the repository at this point in the history
Resolves: #8236
  • Loading branch information
luigidellaquila committed Apr 23, 2018
1 parent 794069f commit f0a1a2e
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

/**
* Converts a document in JSON string.
*
*
* @author Johann Sorel (Geomatys)
* @author Luca Garulli (l.garulli--(at)--orientdb.com)
*/
Expand Down Expand Up @@ -66,8 +66,13 @@ public Object execute(Object iThis, OIdentifiable iCurrentRecord, OCommandContex

StringBuilder builder = new StringBuilder();
builder.append("[");
boolean first = true;
for (Object o : OMultiValue.getMultiValueIterable(iThis, false)) {
if (!first) {
builder.append(",");
}
builder.append(execute(o, iCurrentRecord, iContext, ioResult, iParams));
first = false;
}

builder.append("]");
Expand Down

0 comments on commit f0a1a2e

Please sign in to comment.