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 `QueryResult` instance must always be closed after its use.

Here is a code sample benefiting from the automatic closing provided by `AutoCloseable` and its associated `try`-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 `QueryResult` supports just one active iterator at a time. When creating an iterator, any iterator previously created for this `QueryResult` will be invalidated.

### Concurrency

A `QueryResult` instance 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

  Modifier and Type
  Method
  Description
  `void`
  `close()`
  `List<String>`
  `getFieldNames()`
  Returns the names of the fields in the result
  `List<Class<?>>`
  `getFieldTypes()`
  Returns the types of the fields in the result

  ### Methods inherited from interface java.lang.Iterable

  `forEach, iterator, spliterator`

- ## Method Details

  - ### getFieldNames

    List<String> getFieldNames()
    Returns the names of the fields in the result

  - ### getFieldTypes

    List<Class<?>> getFieldTypes()
    Returns the types of the fields in the result

  - ### close

    void close()
    Specified by:
      `close` in interface `AutoCloseable`