Package com.buschmais.jqassistant.core.store.api

Examples of com.buschmais.jqassistant.core.store.api.QueryResult


     * @return The result.
     * @throws AnalyzerException If query execution fails.
     */
    private <T extends AbstractExecutable> Result<T> execute(T executable) throws AnalyzerException {
        List<Map<String, Object>> rows = new ArrayList<>();
        QueryResult queryResult = null;
        try {
            store.beginTransaction();
            queryResult = executeQuery(executable.getQuery());
            for (QueryResult.Row row : queryResult.getRows()) {
                rows.add(row.get());
            }
            store.commitTransaction();
            return new Result<T>(executable, queryResult.getColumns(), rows);
        } catch (RuntimeException e) {
            store.rollbackTransaction();
            throw new AnalyzerException("Cannot execute query: " + executable.getQuery(), e);
        } finally {
            IOUtils.closeQuietly(queryResult);
View Full Code Here


    @Override
    public QueryResult executeQuery(String query, Map<String, Object> parameters) {
        ExecutionResult result = executionEngine.execute(query, parameters);
        Iterable<QueryResult.Row> rowIterable = new RowIterable(result.iterator());
        return new QueryResult(result.columns(), rowIterable);
    }
View Full Code Here

TOP

Related Classes of com.buschmais.jqassistant.core.store.api.QueryResult

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.