Package com.orchestranetworks.query
Interface QueryResult<T>
-
- All Superinterfaces:
AutoCloseable,Iterable<T>
public interface QueryResult<T> extends Iterable<T>, AutoCloseable
Represents the result of a query.Traversing and closing the result
A
QueryResultinstance must always be closed after its use.Here is a code sample benefiting from the automatic closing provided by
AutoCloseableand its associatedtry-with-resources notation:Query<Tuple> query = dataset.createQuery("SELECT id, name FROM customer"); try (QueryResult<Tuple> result = query.getResult()) { for (Tuple t : result) { Integer id = t.get(0, Integer.class); String name = t.get(1, String.class); ... } }Note that a
QueryResultsupports just one active iterator at a time. When creating an iterator, any iterator previously created for thisQueryResultwill be invalidated.Concurrency
A
QueryResultinstance is not thread-safe and it must be used only by the thread that created it.If the table is concurrently updated, the rules specified by Query snapshot isolation apply.
- Since:
- 6.0.0
- See Also:
Query.getResult(), Query snapshot isolation
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidclose()List<String>getFieldNames()Returns the names of the fields in the resultList<Class<?>>getFieldTypes()Returns the types of the fields in the result-
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
-