mirror of
https://github.com/querydsl/querydsl.git
synced 2026-07-03 21:07:49 +08:00
extended DetachableQuery
This commit is contained in:
parent
739fbfcf4d
commit
a875cd8d25
@ -35,6 +35,14 @@ public interface Detachable {
|
||||
* @return a List over the projection
|
||||
*/
|
||||
ListSubQuery<Object[]> list(Expr<?> first, Expr<?> second, Expr<?>... rest);
|
||||
|
||||
/**
|
||||
*
|
||||
*
|
||||
* @param args
|
||||
* @return
|
||||
*/
|
||||
ListSubQuery<Object[]> list(Expr<?>[] args);
|
||||
|
||||
/**
|
||||
* Create a projection expression for the given projection
|
||||
@ -55,6 +63,14 @@ public interface Detachable {
|
||||
* @return
|
||||
*/
|
||||
ObjectSubQuery<Object[]> unique(Expr<?> first, Expr<?> second, Expr<?>... rest);
|
||||
|
||||
/**
|
||||
* Create a projection expression for the given projection
|
||||
*
|
||||
* @param args
|
||||
* @return
|
||||
*/
|
||||
ObjectSubQuery<Object[]> unique(Expr<?>[] args);
|
||||
|
||||
/**
|
||||
* Create a projection expression for the given projection
|
||||
|
||||
@ -33,6 +33,13 @@ public class DetachableMixin implements Detachable{
|
||||
queryMixin.addToProjection(Ops.AggOps.COUNT_ALL_AGG_EXPR);
|
||||
return new ObjectSubQuery<Long>(queryMixin.getMetadata(), Long.class);
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ListSubQuery<Object[]> list(Expr<?>[] args) {
|
||||
queryMixin.addToProjection(args);
|
||||
return new ListSubQuery<Object[]>(queryMixin.getMetadata(), Object[].class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ListSubQuery<Object[]> list(Expr<?> first, Expr<?> second, Expr<?>... rest) {
|
||||
@ -47,6 +54,14 @@ public class DetachableMixin implements Detachable{
|
||||
queryMixin.addToProjection(projection);
|
||||
return new ListSubQuery<RT>(queryMixin.getMetadata(), (Class)projection.getType());
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public ObjectSubQuery<Object[]> unique(Expr<?>[] args) {
|
||||
queryMixin.addToProjection(args);
|
||||
queryMixin.setUnique(true);
|
||||
return new ObjectSubQuery<Object[]>(queryMixin.getMetadata(), Object[].class);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ObjectSubQuery<Object[]> unique(Expr<?> first, Expr<?> second, Expr<?>... rest) {
|
||||
|
||||
@ -18,7 +18,7 @@ import com.mysema.query.types.query.ObjectSubQuery;
|
||||
*
|
||||
* @param <SubType>
|
||||
*/
|
||||
public abstract class DetachableQuery <SubType extends DetachableQuery<SubType>> extends QueryBase<SubType> implements Detachable {
|
||||
public class DetachableQuery <SubType extends DetachableQuery<SubType>> extends QueryBase<SubType> implements Detachable {
|
||||
|
||||
private final DetachableMixin detachableMixin;
|
||||
|
||||
@ -62,4 +62,14 @@ public abstract class DetachableQuery <SubType extends DetachableQuery<SubType>>
|
||||
return detachableMixin.unique(projection);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ListSubQuery<Object[]> list(Expr<?>[] args) {
|
||||
return detachableMixin.list(args);
|
||||
}
|
||||
|
||||
@Override
|
||||
public ObjectSubQuery<Object[]> unique(Expr<?>[] args) {
|
||||
return detachableMixin.unique(args);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user