}
Annotation[] annotations = AnnotationUtil.compileAnnotations(spec.getAnnotations(), services.getEngineImportService(), epl);
StatementContext statementContext = services.getStatementContextFactory().makeContext(stmtId, stmtName, epl, services, null, true, annotations, null, true, spec);
// walk subselects, declared expressions, dot-expressions
ExprNodeSubselectDeclaredDotVisitor visitor;
try {
visitor = StatementSpecRawAnalyzer.walkSubselectAndDeclaredDotExpr(spec);
}
catch (ExprValidationException ex) {
throw new EPStatementException(ex.getMessage(), epl);
}
StatementSpecCompiled compiledSpec = StatementLifecycleSvcImpl.compile(spec, epl, statementContext, false, true, annotations, visitor.getSubselects(), Collections.<ExprDeclaredNode>emptyList(), services);
if (compiledSpec.getInsertIntoDesc() != null) {
return new EPPreparedExecuteInsertInto(compiledSpec, services, statementContext);
}
else if (compiledSpec.getFireAndForgetSpec() == null) { // null indicates a select-statement, same as continuous query
return new EPPreparedExecuteMethodQuery(compiledSpec, services, statementContext);