use of org.codehaus.jackson.map.annotate.JsonView in project activityinfo by bedatadriven.
the class RootResource method getCountries.
@GET
@Path("/countries")
@JsonView(DTOViews.List.class)
@Produces(MediaType.APPLICATION_JSON)
public List<CountryDTO> getCountries() {
QueryModel model = new QueryModel(CountryTable.FORM_CLASS_ID);
model.selectField(CountryTable.CODE_FIELD_ID).as("code");
model.selectField(CountryTable.NAME_FIELD_ID).as("name");
return dispatcher.execute(new GetCountries()).getData();
}
Aggregations