use of org.apache.cayenne.util.QueryResultBuilder in project cayenne by apache.
the class MappedExec method execute.
public QueryResult execute(ObjectContext context) {
// TODO: switch ObjectContext to QueryResult instead of QueryResponse
// and create its own 'exec' method
QueryResponse response = context.performGenericQuery(this);
QueryResultBuilder builder = QueryResultBuilder.builder(response.size());
for (response.reset(); response.next(); ) {
if (response.isList()) {
builder.addSelectResult(response.currentList());
} else {
builder.addBatchUpdateResult(response.currentUpdateCount());
}
}
return builder.build();
}
use of org.apache.cayenne.util.QueryResultBuilder in project cayenne by apache.
the class SQLExec method execute.
public QueryResult execute(ObjectContext context) {
// TODO: switch ObjectContext to QueryResult instead of QueryResponse
// and create its own 'exec' method
QueryResponse response = context.performGenericQuery(this);
QueryResultBuilder builder = QueryResultBuilder.builder(response.size());
for (response.reset(); response.next(); ) {
if (response.isList()) {
builder.addSelectResult(response.currentList());
} else {
builder.addBatchUpdateResult(response.currentUpdateCount());
}
}
return builder.build();
}
Aggregations