예제 #1
0
  public int run(Connection connection, Documents documents, Query query) throws Exception {
    List<Object> values;

    if (query.getStatement() == null) throw new IocasteException("query statement not defined.");

    values = new ArrayList<>();
    String sql = Parser.parseQuery(connection, query, values, documents);
    return update(connection, sql, values.toArray());
  }
예제 #2
0
  public final Object[] generic(Connection connection, Query query) throws Exception {
    List<Object> values;
    String statement;
    Documents documents;

    if (query.getStatement() != null) throw new Exception("statement for select must be null.");

    documents = getFunction();
    values = new ArrayList<>();
    statement = Parser.parseQuery(connection, query, values, documents);
    if (values.size() == 0) return select(connection, statement, query.getMaxResults());

    return select(connection, statement, query.getMaxResults(), values.toArray());
  }