Skip to content
This repository has been archived by the owner on Jun 16, 2020. It is now read-only.

Commit

Permalink
Converted array into object to expose keys
Browse files Browse the repository at this point in the history
  • Loading branch information
Dimitriy Remerov committed Sep 8, 2016
1 parent 318210d commit 559a2bb
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/main/java/org/wololo/jdbc/resources/RowsResource.java
Original file line number Diff line number Diff line change
Expand Up @@ -208,11 +208,11 @@ void writeRows(
}

void writeRow(final JsonGenerator jsonGenerator, final Record record) throws SQLException, JsonGenerationException, IOException {
jsonGenerator.writeStartArray();
for (Object value : record.intoArray()) {
jsonGenerator.writeObject(value);
jsonGenerator.writeStartObject();
for (Map.Entry<String, Object> entry : record.intoMap().entrySet()) {
jsonGenerator.writeObjectField(entry.getKey(), entry.getValue());
}
jsonGenerator.writeEndArray();
jsonGenerator.writeEndObject();
}

List<Field<Object>> getFields() throws SQLException {
Expand Down

0 comments on commit 559a2bb

Please sign in to comment.