From 05df9ee9c7dd0786f188e9fa04d2cd4fd6a68d72 Mon Sep 17 00:00:00 2001 From: lukaseder Date: Sat, 30 May 2015 18:05:41 +0200 Subject: [PATCH] [#4336] Let Cursor and Query extend AutoCloseable --- jOOQ/src/main/java/org/jooq/Cursor.java | 5 ++++- jOOQ/src/main/java/org/jooq/Query.java | 5 ++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/jOOQ/src/main/java/org/jooq/Cursor.java b/jOOQ/src/main/java/org/jooq/Cursor.java index 37822a722f..b734e23dc1 100644 --- a/jOOQ/src/main/java/org/jooq/Cursor.java +++ b/jOOQ/src/main/java/org/jooq/Cursor.java @@ -67,7 +67,7 @@ import org.jooq.impl.DefaultRecordMapper; * @param The cursor's record type * @author Lukas Eder */ -public interface Cursor extends Iterable { +public interface Cursor extends Iterable /* [java-8] */, AutoCloseable /* [java-8] */ { /** * Get this cursor's row type. @@ -372,6 +372,9 @@ public interface Cursor extends Iterable { * * @throws DataAccessException if something went wrong executing the query */ + /* [java-8] */ + @Override + /* [/java-8] */ void close() throws DataAccessException; /** diff --git a/jOOQ/src/main/java/org/jooq/Query.java b/jOOQ/src/main/java/org/jooq/Query.java index 8d94ea1f13..703c0a89ca 100644 --- a/jOOQ/src/main/java/org/jooq/Query.java +++ b/jOOQ/src/main/java/org/jooq/Query.java @@ -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; /**