}
@Override
public Response execute(Request req) {
try {
Command cmd = EGQLUtil.parser(req.getCommand()).command().cmd;
// validate all statements
for (Statement stmt : cmd.getStatements()) {
stmt.validate();
}
// validation passed, kick off all statements
Response resp = new Response();
for (Statement stmt : cmd.getStatements()) {
// TODO : how to handle exceptions for simple statement?
if (stmt.isSimpleStatement()) {
if (stmt instanceof InsertStatement) {
InsertStatement insertStmt = (InsertStatement) stmt;