Top Description Methods
org.jooq

public Interface Results

extends List<Result<Record>>, Attachable
Known Direct Implementers
org.jooq.impl.ResultsImpl
Imports
java.sql.SQLException, java.util.List, org.jooq.conf.Settings, .ThrowExceptions, org.jetbrains.annotations.NotNull

A list of Result and update counts that can be returned by ResultQuery#fetchMany() calls and other calls that produce multiple cursors and update counts.

For backwards-compatibility (e.g. with ResultQuery#fetchMany()), this type extends List containing only the Result, not the rows, update counts, exceptions of interleaved updates. In order to get them all, call resultsOrRows() upon the results.

Exceptions

Some databases support raising several errors or exceptions per statement batch (e.g. SQLDialect#SQLSERVER):


INSERT INTO t VALUES (1),(2),(3);
RAISERROR('message 1', 16, 2, 3);
RAISERROR('message 2', 16, 2, 3);
SELECT * FROM t;
RAISERROR('message 3', 16, 2, 3);

The above batch will produce:

By default (or when explicitly specifying ThrowExceptions#THROW_ALL in Settings#getThrowExceptions()), this particular batch will produce a single exception corresponding to "message 1", with additional exceptions for "message 2" and "message 3" attached to SQLException#getNextException(), recursively.

When specifying ThrowExceptions#THROW_FIRST, only "message 1" is propagated. When specifying ThrowExceptions#THROW_NONE, then all exceptions are collected as results and are made available through resultsOrRows() in ResultOrRows#exception().

Author
Lukas Eder

Method Summary

Modifier and TypeMethod and Description
public void
attach(Configuration
A configuration or null, if you wish to detach this Attachable from its previous configuration.
configuration
)

Redeclares org.jooq.Attachable.attach.

Attach all results and all of their contained records to a new Configuration.
public void
detach()

Redeclares org.jooq.Attachable.detach.

Detach all results and all of their contained records from their current Configuration.
public @NotNull List<ResultOrRows>
resultsOrRows()

All the results or update counts in their order as fetched via JDBC.

Inherited from java.util.List:
addaddaddAlladdAlladdFirstaddLastclearcontainscontainsAllcopyOfequalsgetgetFirstgetLasthashCodeindexOfisEmptyiteratorlastIndexOflistIteratorlistIteratorofofofofofofofofofofofofremoveremoveremoveAllremoveFirstremoveLastreplaceAllretainAllreversedsetsizesortspliteratorsubListtoArraytoArray
Inherited from org.jooq.Attachable:
configuration

Method Detail

attachback to summary
public void attach(Configuration configuration)

Redeclares org.jooq.Attachable.attach.

Attach all results and all of their contained records to a new Configuration.

Parameters
configuration:Configuration

A configuration or null, if you wish to detach this Attachable from its previous configuration.

Annotations
@Override
detachback to summary
public void detach()

Redeclares org.jooq.Attachable.detach.

Detach all results and all of their contained records from their current Configuration.

This is the same as calling attach(null).

Annotations
@Override
resultsOrRowsback to summary
public @NotNull List<ResultOrRows> resultsOrRows()

All the results or update counts in their order as fetched via JDBC.

While iterator() and all the other methods inherited from the List API return the Result objects only, this method also includes update counts that may have occurred between two results.

It can be safely assumed that:


result.resultsOrRows()
      .stream()
      .filter(r -> r.result() != null)
      .map(r -> r.result())
      .collect(Collectors.toList())
      .equals(result);
Annotations
@NotNull