#600317 : added StoreClause as superinterface for InsertClause and UpdateClause

This commit is contained in:
Timo Westkämper 2010-07-02 12:12:09 +00:00
parent 7dc612ded8
commit 2ecdcfa737
3 changed files with 37 additions and 40 deletions

View File

@ -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 <C>
*/
public interface InsertClause<C extends InsertClause<C>> {
public interface InsertClause<C extends InsertClause<C>> extends StoreClause<C>{
/**
* Define the columns to be populated
@ -27,13 +25,6 @@ public interface InsertClause<C extends InsertClause<C>> {
*/
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 extends InsertClause<C>> {
*/
C select(SubQuery<?> subQuery);
/**
* Add a value binding
*
* @param <T>
* @param path path to be updated
* @param value value to set
* @return
*/
<T> C set(Path<T> path, @Nullable T value);
/**
* Define the value bindings
*

View File

@ -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 <C>
*/
public interface StoreClause<C extends StoreClause<C>> {
/**
* Execute the clause and return the amount of inserted/updated rows/items
*
* @return
*/
long execute();
/**
* Add a value binding
*
* @param <T>
* @param path path to be updated
* @param value value to set
* @return
*/
<T> C set(Path<T> path, @Nullable T value);
}

View File

@ -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 <C>
*/
public interface UpdateClause<C extends UpdateClause<C>> {
/**
* Execute the delete clause and return the amount of updated rows/items
*
* @return
*/
long execute();
public interface UpdateClause<C extends UpdateClause<C>> extends StoreClause<C>{
/**
* Set the paths to be updated
@ -37,16 +28,6 @@ public interface UpdateClause<C extends UpdateClause<C>> {
*/
C set(List<? extends Path<?>> paths, List<?> values);
/**
* Set the path to be updated
*
* @param <T>
* @param path path to be updated
* @param value value to set
* @return
*/
<T> C set(Path<T> path, @Nullable T value);
/**
* Defines the filter constraints
*