Skip to content

Commit

Permalink
More information has been added to columns API.
Browse files Browse the repository at this point in the history
  • Loading branch information
keiono committed Aug 13, 2014
1 parent 55e1db9 commit 58ac96b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,8 @@ public final String serializeColumns(final Collection<CyColumn> columns) throws
generator.writeStartObject();
generator.writeStringField(JsonTags.COLUMN_NAME, column.getName());
generator.writeStringField(JsonTags.COLUMN_TYPE, column.getType().getSimpleName());
generator.writeBooleanField(JsonTags.COLUMN_IMMUTABLE, column.isImmutable());
generator.writeBooleanField(JsonTags.PRIMARY_KEY, column.isPrimaryKey());
generator.writeEndObject();
}
generator.writeEndArray();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ public class JsonTags {
public static final String COLUMN_NAME = "name";
public static final String COLUMN_TYPE = "type";
public static final String COLUMN_VALUES = "values";
public static final String COLUMN_IMMUTABLE = "immutable";

public static final String TABLE_FORMAT = "format";
}
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public void createColumn(@PathParam("networkId") Long id, @PathParam("tableType"
tableMapper.createNewColumn(rootNode, table);
} catch (IOException e) {
e.printStackTrace();
throw new WebApplicationException(e, 500);
throw new WebApplicationException("Could not create column.", e, 500);
}
}

Expand Down Expand Up @@ -220,10 +220,11 @@ public String getColumnNames(@PathParam("networkId") Long id, @PathParam("tableT
try {
return this.serializer.serializeColumns(table.getColumns());
} catch (IOException e) {
throw new WebApplicationException(e, 500);
throw new WebApplicationException("Could not get column names.", e, 500);
}
}


@GET
@Path("/{tableType}/columns/{columnName}")
@Produces(MediaType.APPLICATION_JSON)
Expand Down

0 comments on commit 58ac96b

Please sign in to comment.