From 4bf092bb2ba12774457b6ce7d66d47823f35d8d2 Mon Sep 17 00:00:00 2001 From: Lukas Eder Date: Mon, 6 Apr 2020 11:43:21 +0200 Subject: [PATCH] [jOOQ/jOOQ#10043] Add Support annotations to TableRecord.insert(), and UpdatableRecord.store(), update(), delete(), etc. --- jOOQ/src/main/java/org/jooq/TableRecord.java | 4 ++++ jOOQ/src/main/java/org/jooq/UpdatableRecord.java | 15 +++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/jOOQ/src/main/java/org/jooq/TableRecord.java b/jOOQ/src/main/java/org/jooq/TableRecord.java index b85ab33983..7437794558 100644 --- a/jOOQ/src/main/java/org/jooq/TableRecord.java +++ b/jOOQ/src/main/java/org/jooq/TableRecord.java @@ -70,6 +70,7 @@ public interface TableRecord> extends Record { * if storing was not necessary. * @throws DataAccessException if something went wrong executing the query */ + @Support int insert() throws DataAccessException; /** @@ -81,6 +82,7 @@ public interface TableRecord> extends Record { * @throws DataAccessException if something went wrong executing the query * @see #insert() */ + @Support int insert(Field... fields) throws DataAccessException; /** @@ -92,6 +94,7 @@ public interface TableRecord> extends Record { * @throws DataAccessException if something went wrong executing the query * @see #insert() */ + @Support int insert(Collection> fields) throws DataAccessException; /** @@ -106,6 +109,7 @@ public interface TableRecord> extends Record { * @see ForeignKey#fetchParents(java.util.Collection) * @see ForeignKey#fetchParents(Record...) */ + @Support > O fetchParent(ForeignKey key) throws DataAccessException; @Override diff --git a/jOOQ/src/main/java/org/jooq/UpdatableRecord.java b/jOOQ/src/main/java/org/jooq/UpdatableRecord.java index 0d64c84984..0f4d7c16df 100644 --- a/jOOQ/src/main/java/org/jooq/UpdatableRecord.java +++ b/jOOQ/src/main/java/org/jooq/UpdatableRecord.java @@ -216,6 +216,7 @@ public interface UpdatableRecord> extends TableReco * @see #insert() * @see #update() */ + @Support int store() throws DataAccessException, DataChangedException; /** @@ -230,6 +231,7 @@ public interface UpdatableRecord> extends TableReco * @see #insert(Field...) * @see #update(Field...) */ + @Support int store(Field... fields) throws DataAccessException, DataChangedException; /** @@ -244,6 +246,7 @@ public interface UpdatableRecord> extends TableReco * @see #insert(Field...) * @see #update(Field...) */ + @Support int store(Collection> fields) throws DataAccessException, DataChangedException; /** @@ -265,6 +268,7 @@ public interface UpdatableRecord> extends TableReco * @throws DataAccessException if something went wrong executing the query * @see #store() */ + @Support @Override int insert() throws DataAccessException; @@ -277,6 +281,7 @@ public interface UpdatableRecord> extends TableReco * @throws DataAccessException if something went wrong executing the query * @see #insert() */ + @Support @Override int insert(Field... fields) throws DataAccessException; @@ -289,6 +294,7 @@ public interface UpdatableRecord> extends TableReco * @throws DataAccessException if something went wrong executing the query * @see #insert() */ + @Support @Override int insert(Collection> fields) throws DataAccessException; @@ -313,6 +319,7 @@ public interface UpdatableRecord> extends TableReco * record has already been changed/deleted in the database * @see #store() */ + @Support int update() throws DataAccessException, DataChangedException; /** @@ -326,6 +333,7 @@ public interface UpdatableRecord> extends TableReco * record has already been changed/deleted in the database * @see #update() */ + @Support int update(Field... fields) throws DataAccessException, DataChangedException; /** @@ -339,6 +347,7 @@ public interface UpdatableRecord> extends TableReco * record has already been changed/deleted in the database * @see #update() */ + @Support int update(Collection> fields) throws DataAccessException, DataChangedException; /** @@ -394,6 +403,7 @@ public interface UpdatableRecord> extends TableReco * @throws DataChangedException If optimistic locking is enabled and the * record has already been changed/deleted in the database */ + @Support int delete() throws DataAccessException, DataChangedException; /** @@ -421,6 +431,7 @@ public interface UpdatableRecord> extends TableReco * @throws NoDataFoundException If the record does not exist anymore in the * database */ + @Support void refresh() throws DataAccessException; /** @@ -448,6 +459,7 @@ public interface UpdatableRecord> extends TableReco * @throws NoDataFoundException If the record does not exist anymore in the * database */ + @Support void refresh(Field... fields) throws DataAccessException, NoDataFoundException; /** @@ -475,6 +487,7 @@ public interface UpdatableRecord> extends TableReco * @throws NoDataFoundException If the record does not exist anymore in the * database */ + @Support void refresh(Collection> fields) throws DataAccessException, NoDataFoundException; /** @@ -498,6 +511,7 @@ public interface UpdatableRecord> extends TableReco * @see ForeignKey#fetchChildren(Record) * @see ForeignKey#fetchChildren(Record...) */ + @Support > O fetchChild(ForeignKey key) throws TooManyRowsException, DataAccessException; /** @@ -511,5 +525,6 @@ public interface UpdatableRecord> extends TableReco * @see ForeignKey#fetchChildren(Record) * @see ForeignKey#fetchChildren(Record...) */ + @Support > Result fetchChildren(ForeignKey key) throws DataAccessException; }