Skip to content

Instantly share code, notes, and snippets.

Last active April 5, 2016 05:50
What would you like to do?
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.beans.factory.annotation.Autowired;
public class QueryController {
private QueryAdapter queryAdapter;
public Graph avg(@PathVariable String tableName,
@PathVariable String field1,
@PathVariable String field2) {
return queryAdapter
.select(field1, field2)
.aggregate(new Average(field1, field2));
// Endpoints for other aggregation functions: sum, count etc.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment