Package org.apache.calcite.runtime
Class ResultSetEnumerable<T>
java.lang.Object
org.apache.calcite.linq4j.DefaultEnumerable<T>
org.apache.calcite.linq4j.AbstractEnumerable<T>
org.apache.calcite.runtime.ResultSetEnumerable<T>
- Type Parameters:
T
- Element type
- All Implemented Interfaces:
Iterable<T>
,Enumerable<T>
,ExtendedEnumerable<T>
,ExtendedOrderedEnumerable<T>
,OrderedEnumerable<T>
,RawEnumerable<T>
Executes a SQL statement and returns the result as an
Enumerable
.-
Nested Class Summary
Modifier and TypeClassDescriptionstatic interface
Consumer for decorating aPreparedStatement
, that is, setting its parameters. -
Method Summary
Modifier and TypeMethodDescriptioncreateEnricher
(Integer[] indexes, DataContext context) Called from generated code that proposes to create aResultSetEnumerable
over a prepared statement.Returns an enumerator that iterates through a collection.static ResultSetEnumerable<@Nullable Object>
of
(DataSource dataSource, String sql) Creates a ResultSetEnumerable.static <T> ResultSetEnumerable<T>
Executes a SQL query and returns the results as an enumerator, using a row builder to convert JDBC column values into rows.static <T> ResultSetEnumerable<T>
of
(DataSource dataSource, String sql, Function1<ResultSet, Function0<T>> rowBuilderFactory, ResultSetEnumerable.PreparedStatementEnricher consumer) Executes a SQL query and returns the results as an enumerator, using a row builder to convert JDBC column values into rows.static ResultSetEnumerable<@Nullable Object>
of
(DataSource dataSource, String sql, Primitive[] primitives) Creates a ResultSetEnumerable that retrieves columns as specific Java types.void
setTimeout
(DataContext context) Methods inherited from class org.apache.calcite.linq4j.AbstractEnumerable
iterator
Methods inherited from class org.apache.calcite.linq4j.DefaultEnumerable
aggregate, aggregate, aggregate, all, any, any, asEnumerable, asofJoin, asOrderedQueryable, asQueryable, average, average, average, average, average, average, average, average, average, average, cast, concat, contains, contains, correlateJoin, count, count, createOrderedEnumerable, defaultIfEmpty, defaultIfEmpty, distinct, distinct, elementAt, elementAtOrDefault, except, except, except, except, first, first, firstOrDefault, firstOrDefault, foreach, getThis, getThisOrdered, groupBy, groupBy, groupBy, groupBy, groupBy, groupBy, groupBy, groupBy, groupBy, groupBy, groupJoin, groupJoin, hashJoin, hashJoin, hashJoin, hashJoin, intersect, intersect, intersect, intersect, into, last, last, lastOrDefault, lastOrDefault, longCount, longCount, max, max, max, max, max, max, max, max, max, max, max, max, min, min, min, min, min, min, min, min, min, min, min, min, ofType, orderBy, orderBy, orderByDescending, orderByDescending, removeAll, reverse, select, select, selectMany, selectMany, selectMany, selectMany, sequenceEqual, sequenceEqual, single, single, singleOrDefault, singleOrDefault, skip, skipWhile, skipWhile, sortedGroupBy, sum, sum, sum, sum, sum, sum, sum, sum, sum, sum, take, takeWhile, takeWhile, thenBy, thenBy, thenByDescending, thenByDescending, toList, toLookup, toLookup, toLookup, toLookup, toMap, toMap, toMap, toMap, union, union, where, where, zip
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Method Details
-
of
Creates a ResultSetEnumerable. -
of
public static ResultSetEnumerable<@Nullable Object> of(DataSource dataSource, String sql, Primitive[] primitives) Creates a ResultSetEnumerable that retrieves columns as specific Java types. -
of
public static <T> ResultSetEnumerable<T> of(DataSource dataSource, String sql, Function1<ResultSet, Function0<T>> rowBuilderFactory) Executes a SQL query and returns the results as an enumerator, using a row builder to convert JDBC column values into rows. -
of
public static <T> ResultSetEnumerable<T> of(DataSource dataSource, String sql, Function1<ResultSet, Function0<T>> rowBuilderFactory, ResultSetEnumerable.PreparedStatementEnricher consumer) Executes a SQL query and returns the results as an enumerator, using a row builder to convert JDBC column values into rows.It uses a
PreparedStatement
for computing the query result, and that means that it can bind parameters. -
setTimeout
-
createEnricher
public static ResultSetEnumerable.PreparedStatementEnricher createEnricher(Integer[] indexes, DataContext context) Called from generated code that proposes to create aResultSetEnumerable
over a prepared statement. -
enumerator
Description copied from interface:RawEnumerable
Returns an enumerator that iterates through a collection.
-