From 2ecdcfa737ae92df3ebbc5dd8ce1270ce81eb9fd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Timo=20Westk=C3=A4mper?= Date: Fri, 2 Jul 2010 12:12:09 +0000 Subject: [PATCH] #600317 : added StoreClause as superinterface for InsertClause and UpdateClause --- .../com/mysema/query/dml/InsertClause.java | 21 +---------- .../com/mysema/query/dml/StoreClause.java | 35 +++++++++++++++++++ .../com/mysema/query/dml/UpdateClause.java | 21 +---------- 3 files changed, 37 insertions(+), 40 deletions(-) create mode 100644 querydsl-core/src/main/java/com/mysema/query/dml/StoreClause.java diff --git a/querydsl-core/src/main/java/com/mysema/query/dml/InsertClause.java b/querydsl-core/src/main/java/com/mysema/query/dml/InsertClause.java index 6b4b31b42..4cabc6456 100644 --- a/querydsl-core/src/main/java/com/mysema/query/dml/InsertClause.java +++ b/querydsl-core/src/main/java/com/mysema/query/dml/InsertClause.java @@ -5,8 +5,6 @@ */ package com.mysema.query.dml; -import javax.annotation.Nullable; - import com.mysema.query.types.Path; import com.mysema.query.types.SubQuery; @@ -17,7 +15,7 @@ import com.mysema.query.types.SubQuery; * * @param */ -public interface InsertClause> { +public interface InsertClause> extends StoreClause{ /** * Define the columns to be populated @@ -27,13 +25,6 @@ public interface InsertClause> { */ C columns(Path... columns); - /** - * Execute the insert clause and return the amount of inserted rows/items - * - * @return - */ - long execute(); - /** * Define the populate via subquery * @@ -42,16 +33,6 @@ public interface InsertClause> { */ C select(SubQuery subQuery); - /** - * Add a value binding - * - * @param - * @param path path to be updated - * @param value value to set - * @return - */ - C set(Path path, @Nullable T value); - /** * Define the value bindings * diff --git a/querydsl-core/src/main/java/com/mysema/query/dml/StoreClause.java b/querydsl-core/src/main/java/com/mysema/query/dml/StoreClause.java new file mode 100644 index 000000000..810d22834 --- /dev/null +++ b/querydsl-core/src/main/java/com/mysema/query/dml/StoreClause.java @@ -0,0 +1,35 @@ +package com.mysema.query.dml; + +import javax.annotation.Nullable; + +import com.mysema.query.types.Path; + +/** + * Parent interface for InsertClause and UpdateClause + * + * @author tiwe + * + * @param + */ +public interface StoreClause> { + + + /** + * Execute the clause and return the amount of inserted/updated rows/items + * + * @return + */ + long execute(); + + /** + * Add a value binding + * + * @param + * @param path path to be updated + * @param value value to set + * @return + */ + C set(Path path, @Nullable T value); + + +} diff --git a/querydsl-core/src/main/java/com/mysema/query/dml/UpdateClause.java b/querydsl-core/src/main/java/com/mysema/query/dml/UpdateClause.java index 264764fdb..92af95be7 100644 --- a/querydsl-core/src/main/java/com/mysema/query/dml/UpdateClause.java +++ b/querydsl-core/src/main/java/com/mysema/query/dml/UpdateClause.java @@ -7,8 +7,6 @@ package com.mysema.query.dml; import java.util.List; -import javax.annotation.Nullable; - import com.mysema.query.types.Path; import com.mysema.query.types.expr.EBoolean; @@ -19,14 +17,7 @@ import com.mysema.query.types.expr.EBoolean; * * @param */ -public interface UpdateClause> { - - /** - * Execute the delete clause and return the amount of updated rows/items - * - * @return - */ - long execute(); +public interface UpdateClause> extends StoreClause{ /** * Set the paths to be updated @@ -37,16 +28,6 @@ public interface UpdateClause> { */ C set(List> paths, List values); - /** - * Set the path to be updated - * - * @param - * @param path path to be updated - * @param value value to set - * @return - */ - C set(Path path, @Nullable T value); - /** * Defines the filter constraints *