[#4336] Let Cursor and Query extend AutoCloseable

This commit is contained in:
lukaseder 2015-05-30 18:05:41 +02:00
parent 2dce62d61d
commit 05df9ee9c7
2 changed files with 8 additions and 2 deletions

View File

@ -67,7 +67,7 @@ import org.jooq.impl.DefaultRecordMapper;
* @param <R> The cursor's record type
* @author Lukas Eder
*/
public interface Cursor<R extends Record> extends Iterable<R> {
public interface Cursor<R extends Record> extends Iterable<R> /* [java-8] */, AutoCloseable /* [java-8] */ {
/**
* Get this cursor's row type.
@ -372,6 +372,9 @@ public interface Cursor<R extends Record> extends Iterable<R> {
*
* @throws DataAccessException if something went wrong executing the query
*/
/* [java-8] */
@Override
/* [/java-8] */
void close() throws DataAccessException;
/**

View File

@ -58,7 +58,7 @@ import org.jooq.impl.DSL;
*
* @author Lukas Eder
*/
public interface Query extends QueryPart, Attachable {
public interface Query extends QueryPart, Attachable /* [java-8] */, AutoCloseable /* [java-8] */ {
/**
* Execute the query, if it has been created with a proper configuration.
@ -282,6 +282,9 @@ public interface Query extends QueryPart, Attachable {
* @throws DataAccessException If something went wrong closing the statement
* @see Statement#close()
*/
/* [java-8] */
@Override
/* [/java-8] */
void close() throws DataAccessException;
/**