mirror of
https://github.com/querydsl/querydsl.git
synced 2026-07-03 21:07:49 +08:00
#600317 : added StoreClause as superinterface for InsertClause and UpdateClause
This commit is contained in:
parent
7dc612ded8
commit
2ecdcfa737
@ -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
|
||||
*
|
||||
|
||||
@ -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);
|
||||
|
||||
|
||||
}
|
||||
@ -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
|
||||
*
|
||||
|
||||
Loading…
Reference in New Issue
Block a user