From 35906b803346ab97021dec61b90716c0e153bef8 Mon Sep 17 00:00:00 2001 From: lukaseder Date: Fri, 26 Jan 2018 10:14:59 +0100 Subject: [PATCH] [#7102] Inaccurate Javadoc for DSLContext.fetchValue() and fetchValues() --- jOOQ/src/main/java/org/jooq/DSLContext.java | 41 +++++++++++++-------- 1 file changed, 26 insertions(+), 15 deletions(-) diff --git a/jOOQ/src/main/java/org/jooq/DSLContext.java b/jOOQ/src/main/java/org/jooq/DSLContext.java index 53b4d685de..b61c5314c5 100644 --- a/jOOQ/src/main/java/org/jooq/DSLContext.java +++ b/jOOQ/src/main/java/org/jooq/DSLContext.java @@ -2247,11 +2247,13 @@ public interface DSLContext extends Scope , AutoCloseable { * @param sql The SQL * @return The values. This will never be null. * @throws DataAccessException if something went wrong executing the query + * @throws InvalidResultException if the query returned a record with more + * than one value * @see SQL */ @Support @PlainSQL - List fetchValues(SQL sql) throws DataAccessException; + List fetchValues(SQL sql) throws DataAccessException, InvalidResultException; /** * Execute a new query holding plain SQL. @@ -2273,11 +2275,13 @@ public interface DSLContext extends Scope , AutoCloseable { * @param sql The SQL * @return The values. This will never be null. * @throws DataAccessException if something went wrong executing the query + * @throws InvalidResultException if the query returned a record with more + * than one value * @see SQL */ @Support @PlainSQL - List fetchValues(String sql) throws DataAccessException; + List fetchValues(String sql) throws DataAccessException, InvalidResultException; /** * Execute a new query holding plain SQL. @@ -2303,12 +2307,14 @@ public interface DSLContext extends Scope , AutoCloseable { * @param bindings The bindings * @return The values. This will never be null. * @throws DataAccessException if something went wrong executing the query + * @throws InvalidResultException if the query returned a record with more + * than one value * @see SQL * @see DSL#sql(String, Object...) */ @Support @PlainSQL - List fetchValues(String sql, Object... bindings) throws DataAccessException; + List fetchValues(String sql, Object... bindings) throws DataAccessException, InvalidResultException; /** * Execute a new query holding plain SQL. @@ -2336,12 +2342,14 @@ public interface DSLContext extends Scope , AutoCloseable { * {numbered placeholder} locations * @return The values. This will never be null. * @throws DataAccessException if something went wrong executing the query + * @throws InvalidResultException if the query returned a record with more + * than one value * @see SQL * @see DSL#sql(String, QueryPart...) */ @Support @PlainSQL - List fetchValues(String sql, QueryPart... parts) throws DataAccessException; + List fetchValues(String sql, QueryPart... parts) throws DataAccessException, InvalidResultException; /** * Execute a query holding plain SQL. @@ -3080,9 +3088,11 @@ public interface DSLContext extends Scope , AutoCloseable { * @param rs The JDBC ResultSet to fetch data from * @return The values. This will never be null. * @throws DataAccessException if something went wrong executing the query + * @throws InvalidResultException if the query returned a record with more + * than one value */ @Support - List fetchValues(ResultSet rs) throws DataAccessException; + List fetchValues(ResultSet rs) throws DataAccessException, InvalidResultException; /** * Fetch a result from a JDBC {@link ResultSet} and return the only @@ -3095,9 +3105,11 @@ public interface DSLContext extends Scope , AutoCloseable { * @param field The field to use in the desired output * @return The values. This will never be null. * @throws DataAccessException if something went wrong executing the query + * @throws InvalidResultException if the query returned a record with more + * than one value */ @Support - List fetchValues(ResultSet rs, Field field) throws DataAccessException; + List fetchValues(ResultSet rs, Field field) throws DataAccessException, InvalidResultException; /** * Fetch a result from a JDBC {@link ResultSet} and return the only @@ -3110,9 +3122,11 @@ public interface DSLContext extends Scope , AutoCloseable { * @param type The data type to use in the desired output * @return The values. This will never be null. * @throws DataAccessException if something went wrong executing the query + * @throws InvalidResultException if the query returned a record with more + * than one value */ @Support - List fetchValues(ResultSet rs, DataType type) throws DataAccessException; + List fetchValues(ResultSet rs, DataType type) throws DataAccessException, InvalidResultException; /** * Fetch a result from a JDBC {@link ResultSet} and return the only @@ -3125,9 +3139,11 @@ public interface DSLContext extends Scope , AutoCloseable { * @param type The data types to use in the desired output * @return The values. This will never be null. * @throws DataAccessException if something went wrong executing the query + * @throws InvalidResultException if the query returned a record with more + * than one value */ @Support - List fetchValues(ResultSet rs, Class type) throws DataAccessException; + List fetchValues(ResultSet rs, Class type) throws DataAccessException, InvalidResultException; /** * Wrap a JDBC {@link ResultSet} into a jOOQ {@link Cursor}. @@ -10635,11 +10651,8 @@ public interface DSLContext extends Scope , AutoCloseable { * @return The value or null, if no record was found. * @throws DataAccessException if something went wrong executing the query * @throws TooManyRowsException if the query returned more than one record - * @throws InvalidResultException if the query returned a record with more - * than one value */ - > T fetchValue(ResultQuery query) - throws DataAccessException, TooManyRowsException, InvalidResultException; + > T fetchValue(ResultQuery query) throws DataAccessException, TooManyRowsException; /** * Execute a {@link ResultQuery} in the context of this @@ -10649,10 +10662,8 @@ public interface DSLContext extends Scope , AutoCloseable { * @return The value or null, if no record was found. * @throws DataAccessException if something went wrong executing the query * @throws TooManyRowsException if the query returned more than one record - * @throws InvalidResultException if the query returned a record with more - * than one value */ - T fetchValue(TableField field) throws DataAccessException, TooManyRowsException, InvalidResultException; + T fetchValue(TableField field) throws DataAccessException, TooManyRowsException; /** * Execute a {@link ResultQuery} in the context of this