@Override public ResultSet queryForResultSet(Statement statement) throws DataAccessException { // noinspection ConstantConditions return query(statement, rs -> rs); }
@Override public boolean execute(PreparedStatementCreator preparedStatementCreator) throws DataAccessException { // noinspection ConstantConditions return query(preparedStatementCreator, ResultSet::wasApplied); }
@Override public ResultSet queryForResultSet(String cql) throws DataAccessException { // noinspection ConstantConditions return query(cql, rs -> rs); }
@Override public <T> T query(PreparedStatementCreator preparedStatementCreator, ResultSetExtractor<T> resultSetExtractor) throws DataAccessException { return query(preparedStatementCreator, null, resultSetExtractor); }
@Override public void query(PreparedStatementCreator preparedStatementCreator, RowCallbackHandler rowCallbackHandler) throws DataAccessException { query(preparedStatementCreator, null, newResultSetExtractor(rowCallbackHandler)); }
@Override public void query(Statement statement, RowCallbackHandler rowCallbackHandler) throws DataAccessException { query(statement, newResultSetExtractor(rowCallbackHandler)); }
@Override public <T> T query(String cql, @Nullable PreparedStatementBinder psb, ResultSetExtractor<T> resultSetExtractor) throws DataAccessException { return query(newPreparedStatementCreator(cql), psb, resultSetExtractor); }
@Override public <T> List<T> query(String cql, RowMapper<T> rowMapper) throws DataAccessException { // noinspection ConstantConditions return query(cql, newResultSetExtractor(rowMapper)); }
@Override public <T> List<T> query(Statement statement, RowMapper<T> rowMapper) throws DataAccessException { // noinspection ConstantConditions return query(statement, newResultSetExtractor(rowMapper)); }
@Override public boolean execute(String cql, @Nullable PreparedStatementBinder psb) throws DataAccessException { // noinspection ConstantConditions return query(newPreparedStatementCreator(cql), psb, ResultSet::wasApplied); }
@Override public void query(PreparedStatementCreator preparedStatementCreator, @Nullable PreparedStatementBinder psb, RowCallbackHandler rowCallbackHandler) throws DataAccessException { query(preparedStatementCreator, psb, newResultSetExtractor(rowCallbackHandler)); }
@Override public <T> List<T> query(String cql, @Nullable PreparedStatementBinder psb, RowMapper<T> rowMapper) throws DataAccessException { // noinspection ConstantConditions return query(newPreparedStatementCreator(cql), psb, newResultSetExtractor(rowMapper)); }
@Override public <T> List<T> queryForList(String cql, Class<T> elementType) throws DataAccessException { // noinspection ConstantConditions return query(cql, newResultSetExtractor(newSingleColumnRowMapper(elementType))); }
@Override public <T> List<T> queryForList(Statement statement, Class<T> elementType) throws DataAccessException { // noinspection ConstantConditions return query(statement, newResultSetExtractor(newSingleColumnRowMapper(elementType))); }
@Override public List<Map<String, Object>> queryForList(String cql) throws DataAccessException { // noinspection ConstantConditions return query(cql, newResultSetExtractor(newColumnMapRowMapper())); }
@Override public List<Map<String, Object>> queryForList(Statement statement) throws DataAccessException { // noinspection ConstantConditions return query(statement, newResultSetExtractor(newColumnMapRowMapper())); }
@Override public ResultSet queryForResultSet(String cql, Object... args) throws DataAccessException { // noinspection ConstantConditions return query(newPreparedStatementCreator(cql), newPreparedStatementBinder(args), rs -> rs); }
@Override public List<Map<String, Object>> queryForList(String cql, Object... args) throws DataAccessException { // noinspection ConstantConditions return query(newPreparedStatementCreator(cql), newPreparedStatementBinder(args), newResultSetExtractor(newColumnMapRowMapper())); }
@Override public <T> List<T> queryForList(String cql, Class<T> elementType, Object... args) throws DataAccessException { // noinspection ConstantConditions return query(newPreparedStatementCreator(cql), newPreparedStatementBinder(args), newResultSetExtractor(newSingleColumnRowMapper(elementType))); }
@Override public <T> T queryForObject(String cql, RowMapper<T> rowMapper, Object... args) throws DataAccessException { return DataAccessUtils.requiredSingleResult( query(newPreparedStatementCreator(cql), newPreparedStatementBinder(args), newResultSetExtractor(rowMapper, 1))); }