public abstract class DetachableSQLQuery<Q extends DetachableSQLQuery<Q>> extends DetachableQuery<Q> implements SQLCommonQuery<Q>
Modifier and Type | Field and Description |
---|---|
protected Configuration |
configuration |
MDC_PARAMETERS, MDC_QUERY, queryMixin
Constructor and Description |
---|
DetachableSQLQuery() |
DetachableSQLQuery(Configuration configuration,
QueryMetadata metadata) |
DetachableSQLQuery(QueryMetadata metadata) |
Modifier and Type | Method and Description |
---|---|
Q |
addFlag(QueryFlag.Position position,
Expression<?> flag)
Add the given Expression as a query flag
|
Q |
addFlag(QueryFlag.Position position,
String flag)
Add the given String literal as a query flag
|
Q |
addFlag(QueryFlag.Position position,
String prefix,
Expression<?> expr)
Add the given prefix and expression as a general query flag
|
Q |
addJoinFlag(String flag)
Add the given String literal as a join flag to the last added join with the
position BEFORE_TARGET
|
Q |
addJoinFlag(String flag,
JoinFlag.Position position)
Add the given String literal as a join flag to the last added join
|
abstract Q |
clone() |
protected abstract SQLSerializer |
createSerializer() |
BooleanExpression |
exists()
Create an exists(this) expression
|
Q |
from(Expression<?>... args)
Defines the sources of the query
|
Q |
from(Expression<?> arg) |
Q |
from(SubQueryExpression<?> subQuery,
Path<?> alias)
Adds a sub query source
|
Q |
fullJoin(EntityPath<?> target)
Adds a full join to the given target
|
<E> Q |
fullJoin(ForeignKey<E> key,
RelationalPath<E> entity)
Adds a full join to the given target
|
<E> Q |
fullJoin(RelationalFunctionCall<E> target,
Path<E> alias)
Adds a full join to the given target
|
Q |
fullJoin(SubQueryExpression<?> target,
Path<?> alias)
Adds a full join to the given target
|
QueryMetadata |
getMetadata() |
SQLBindings |
getSQL(Expression<?>... exprs)
Get the query as an SQL query string and bindings
|
Q |
innerJoin(EntityPath<?> target)
Adds an inner join to the given target
|
<E> Q |
innerJoin(ForeignKey<E> key,
RelationalPath<E> entity)
Adds an inner join to the given target
|
<E> Q |
innerJoin(RelationalFunctionCall<E> target,
Path<E> alias)
Adds a full join to the given target
|
Q |
innerJoin(SubQueryExpression<?> target,
Path<?> alias)
Adds an inner join to the given target
|
Q |
join(EntityPath<?> target)
Adds a join to the given target
|
<E> Q |
join(ForeignKey<E> key,
RelationalPath<E> entity)
Adds a join to the given target
|
<E> Q |
join(RelationalFunctionCall<E> target,
Path<E> alias)
Adds a full join to the given target
|
Q |
join(SubQueryExpression<?> target,
Path<?> alias)
Adds a join to the given target
|
Q |
leftJoin(EntityPath<?> target)
Adds a left join to the given target
|
<E> Q |
leftJoin(ForeignKey<E> key,
RelationalPath<E> entity)
Adds a left join to the given target
|
<E> Q |
leftJoin(RelationalFunctionCall<E> target,
Path<E> alias)
Adds a full join to the given target
|
Q |
leftJoin(SubQueryExpression<?> target,
Path<?> alias)
Adds a left join to the given target
|
BooleanExpression |
notExists()
Create an not exists(this) expression
|
Q |
on(Predicate... conditions)
Defines a filter to the last added join
|
Q |
on(Predicate condition) |
Q |
rightJoin(EntityPath<?> target)
Adds a right join to the given target
|
<E> Q |
rightJoin(ForeignKey<E> key,
RelationalPath<E> entity)
Adds a right join to the given target
|
<E> Q |
rightJoin(RelationalFunctionCall<E> target,
Path<E> alias)
Adds a full join to the given target
|
Q |
rightJoin(SubQueryExpression<?> target,
Path<?> alias)
Adds a right join to the given target
|
protected SQLSerializer |
serialize(boolean forCountRow) |
String |
toString() |
<T> CollectionExpressionBase<?,T> |
union(List<? extends SubQueryExpression<T>> sq) |
<T> CollectionExpressionBase<?,T> |
union(ListSubQuery<T>... sq) |
<T> CollectionExpressionBase<?,T> |
union(SubQueryExpression<T>... sq) |
<T> CollectionExpressionBase<?,T> |
unionAll(List<? extends SubQueryExpression<T>> sq) |
<T> CollectionExpressionBase<?,T> |
unionAll(ListSubQuery<T>... sq) |
<T> CollectionExpressionBase<?,T> |
unionAll(SubQueryExpression<T>... sq) |
Q |
with(Path<?> alias,
Expression<?> query)
Adds a common table expression
|
WithBuilder<Q> |
with(Path<?> alias,
Path<?>... columns)
Adds a common table expression
|
Q |
with(Path<?> alias,
SubQueryExpression<?> target)
Adds a common table expression
|
Q |
withRecursive(Path<?> alias,
Expression<?> query)
Adds a common table expression
|
WithBuilder<Q> |
withRecursive(Path<?> alias,
Path<?>... columns)
Adds a common table expression
|
Q |
withRecursive(Path<?> alias,
SubQueryExpression<?> query)
Adds a common table expression
|
count, list, list, list, list, unique, unique, unique, unique, unique, unique, unique, unique, unique, unique
distinct, equals, groupBy, groupBy, hashCode, having, having, limit, offset, orderBy, orderBy, restrict, set, where, where
finalize, getClass, notify, notifyAll, wait, wait, wait
distinct, limit, offset, orderBy, restrict, set
where
protected final Configuration configuration
public DetachableSQLQuery()
public DetachableSQLQuery(QueryMetadata metadata)
public DetachableSQLQuery(Configuration configuration, QueryMetadata metadata)
@WithBridgeMethods(value=AbstractSQLSubQuery.class, castRequired=true) public Q addFlag(QueryFlag.Position position, String prefix, Expression<?> expr)
addFlag
in interface SQLCommonQuery<Q extends DetachableSQLQuery<Q>>
position
- position of the flagprefix
- prefix for the flagexpr
- expression of the flag@WithBridgeMethods(value=AbstractSQLSubQuery.class, castRequired=true) public Q addFlag(QueryFlag.Position position, String flag)
addFlag
in interface SQLCommonQuery<Q extends DetachableSQLQuery<Q>>
position
- flag
- @WithBridgeMethods(value=AbstractSQLSubQuery.class, castRequired=true) public Q addFlag(QueryFlag.Position position, Expression<?> flag)
addFlag
in interface SQLCommonQuery<Q extends DetachableSQLQuery<Q>>
position
- flag
- @WithBridgeMethods(value=AbstractSQLSubQuery.class, castRequired=true) public Q addJoinFlag(String flag)
addJoinFlag
in interface SQLCommonQuery<Q extends DetachableSQLQuery<Q>>
flag
- @WithBridgeMethods(value=AbstractSQLSubQuery.class, castRequired=true) public Q addJoinFlag(String flag, JoinFlag.Position position)
addJoinFlag
in interface SQLCommonQuery<Q extends DetachableSQLQuery<Q>>
flag
- position
- public BooleanExpression exists()
Detachable
Usage
query.where(subQuery.from(customer).where(...).exists())
exists
in interface Detachable
exists
in class DetachableQuery<Q extends DetachableSQLQuery<Q>>
public BooleanExpression notExists()
Detachable
Usage
query.where(subQuery.from(customer).where(...).notExists())
notExists
in interface Detachable
notExists
in class DetachableQuery<Q extends DetachableSQLQuery<Q>>
@WithBridgeMethods(value=AbstractSQLSubQuery.class, castRequired=true) public Q from(Expression<?> arg)
@WithBridgeMethods(value=AbstractSQLSubQuery.class, castRequired=true) public Q from(Expression<?>... args)
SQLCommonQuery
from
in interface SQLCommonQuery<Q extends DetachableSQLQuery<Q>>
@WithBridgeMethods(value=AbstractSQLSubQuery.class, castRequired=true) public Q from(SubQueryExpression<?> subQuery, Path<?> alias)
SQLCommonQuery
from
in interface SQLCommonQuery<Q extends DetachableSQLQuery<Q>>
@WithBridgeMethods(value=AbstractSQLSubQuery.class, castRequired=true) public Q fullJoin(EntityPath<?> target)
SQLCommonQuery
fullJoin
in interface SQLCommonQuery<Q extends DetachableSQLQuery<Q>>
@WithBridgeMethods(value=AbstractSQLSubQuery.class, castRequired=true) public <E> Q fullJoin(RelationalFunctionCall<E> target, Path<E> alias)
SQLCommonQuery
fullJoin
in interface SQLCommonQuery<Q extends DetachableSQLQuery<Q>>
@WithBridgeMethods(value=AbstractSQLSubQuery.class, castRequired=true) public <E> Q fullJoin(ForeignKey<E> key, RelationalPath<E> entity)
SQLCommonQuery
fullJoin
in interface SQLCommonQuery<Q extends DetachableSQLQuery<Q>>
@WithBridgeMethods(value=AbstractSQLSubQuery.class, castRequired=true) public Q fullJoin(SubQueryExpression<?> target, Path<?> alias)
SQLCommonQuery
fullJoin
in interface SQLCommonQuery<Q extends DetachableSQLQuery<Q>>
@WithBridgeMethods(value=AbstractSQLSubQuery.class, castRequired=true) public Q innerJoin(EntityPath<?> target)
SQLCommonQuery
innerJoin
in interface SQLCommonQuery<Q extends DetachableSQLQuery<Q>>
@WithBridgeMethods(value=AbstractSQLSubQuery.class, castRequired=true) public <E> Q innerJoin(RelationalFunctionCall<E> target, Path<E> alias)
SQLCommonQuery
innerJoin
in interface SQLCommonQuery<Q extends DetachableSQLQuery<Q>>
@WithBridgeMethods(value=AbstractSQLSubQuery.class, castRequired=true) public <E> Q innerJoin(ForeignKey<E> key, RelationalPath<E> entity)
SQLCommonQuery
innerJoin
in interface SQLCommonQuery<Q extends DetachableSQLQuery<Q>>
@WithBridgeMethods(value=AbstractSQLSubQuery.class, castRequired=true) public Q innerJoin(SubQueryExpression<?> target, Path<?> alias)
SQLCommonQuery
innerJoin
in interface SQLCommonQuery<Q extends DetachableSQLQuery<Q>>
@WithBridgeMethods(value=AbstractSQLSubQuery.class, castRequired=true) public Q join(EntityPath<?> target)
SQLCommonQuery
join
in interface SQLCommonQuery<Q extends DetachableSQLQuery<Q>>
@WithBridgeMethods(value=AbstractSQLSubQuery.class, castRequired=true) public <E> Q join(RelationalFunctionCall<E> target, Path<E> alias)
SQLCommonQuery
join
in interface SQLCommonQuery<Q extends DetachableSQLQuery<Q>>
@WithBridgeMethods(value=AbstractSQLSubQuery.class, castRequired=true) public <E> Q join(ForeignKey<E> key, RelationalPath<E> entity)
SQLCommonQuery
join
in interface SQLCommonQuery<Q extends DetachableSQLQuery<Q>>
@WithBridgeMethods(value=AbstractSQLSubQuery.class, castRequired=true) public Q join(SubQueryExpression<?> target, Path<?> alias)
SQLCommonQuery
join
in interface SQLCommonQuery<Q extends DetachableSQLQuery<Q>>
@WithBridgeMethods(value=AbstractSQLSubQuery.class, castRequired=true) public Q leftJoin(EntityPath<?> target)
SQLCommonQuery
leftJoin
in interface SQLCommonQuery<Q extends DetachableSQLQuery<Q>>
@WithBridgeMethods(value=AbstractSQLSubQuery.class, castRequired=true) public <E> Q leftJoin(RelationalFunctionCall<E> target, Path<E> alias)
SQLCommonQuery
leftJoin
in interface SQLCommonQuery<Q extends DetachableSQLQuery<Q>>
@WithBridgeMethods(value=AbstractSQLSubQuery.class, castRequired=true) public <E> Q leftJoin(ForeignKey<E> key, RelationalPath<E> entity)
SQLCommonQuery
leftJoin
in interface SQLCommonQuery<Q extends DetachableSQLQuery<Q>>
@WithBridgeMethods(value=AbstractSQLSubQuery.class, castRequired=true) public Q leftJoin(SubQueryExpression<?> target, Path<?> alias)
SQLCommonQuery
leftJoin
in interface SQLCommonQuery<Q extends DetachableSQLQuery<Q>>
@WithBridgeMethods(value=AbstractSQLSubQuery.class, castRequired=true) public Q on(Predicate condition)
@WithBridgeMethods(value=AbstractSQLSubQuery.class, castRequired=true) public Q on(Predicate... conditions)
SQLCommonQuery
on
in interface SQLCommonQuery<Q extends DetachableSQLQuery<Q>>
@WithBridgeMethods(value=AbstractSQLSubQuery.class, castRequired=true) public Q rightJoin(EntityPath<?> target)
SQLCommonQuery
rightJoin
in interface SQLCommonQuery<Q extends DetachableSQLQuery<Q>>
@WithBridgeMethods(value=AbstractSQLSubQuery.class, castRequired=true) public <E> Q rightJoin(RelationalFunctionCall<E> target, Path<E> alias)
SQLCommonQuery
rightJoin
in interface SQLCommonQuery<Q extends DetachableSQLQuery<Q>>
@WithBridgeMethods(value=AbstractSQLSubQuery.class, castRequired=true) public <E> Q rightJoin(ForeignKey<E> key, RelationalPath<E> entity)
SQLCommonQuery
rightJoin
in interface SQLCommonQuery<Q extends DetachableSQLQuery<Q>>
@WithBridgeMethods(value=AbstractSQLSubQuery.class, castRequired=true) public Q rightJoin(SubQueryExpression<?> target, Path<?> alias)
SQLCommonQuery
rightJoin
in interface SQLCommonQuery<Q extends DetachableSQLQuery<Q>>
public <T> CollectionExpressionBase<?,T> union(List<? extends SubQueryExpression<T>> sq)
public <T> CollectionExpressionBase<?,T> union(ListSubQuery<T>... sq)
public <T> CollectionExpressionBase<?,T> union(SubQueryExpression<T>... sq)
public <T> CollectionExpressionBase<?,T> unionAll(List<? extends SubQueryExpression<T>> sq)
public <T> CollectionExpressionBase<?,T> unionAll(ListSubQuery<T>... sq)
public <T> CollectionExpressionBase<?,T> unionAll(SubQueryExpression<T>... sq)
@WithBridgeMethods(value=AbstractSQLSubQuery.class, castRequired=true) public Q withRecursive(Path<?> alias, SubQueryExpression<?> query)
SQLCommonQuery
Usage
query.withRecursive(alias, subQuery) .from(...)
withRecursive
in interface SQLCommonQuery<Q extends DetachableSQLQuery<Q>>
@WithBridgeMethods(value=AbstractSQLSubQuery.class, castRequired=true) public Q withRecursive(Path<?> alias, Expression<?> query)
SQLCommonQuery
Usage
query.withRecursive(alias, subQuery) .from(...)
withRecursive
in interface SQLCommonQuery<Q extends DetachableSQLQuery<Q>>
@WithBridgeMethods(value=AbstractSQLSubQuery.class, castRequired=true) public WithBuilder<Q> withRecursive(Path<?> alias, Path<?>... columns)
SQLCommonQuery
Usage
query.withRecursive(alias, columns...).as(subQuery) .from(...)
withRecursive
in interface SQLCommonQuery<Q extends DetachableSQLQuery<Q>>
@WithBridgeMethods(value=AbstractSQLSubQuery.class, castRequired=true) public Q with(Path<?> alias, SubQueryExpression<?> target)
SQLCommonQuery
Usage
query.with(alias, subQuery) .from(...)
with
in interface SQLCommonQuery<Q extends DetachableSQLQuery<Q>>
@WithBridgeMethods(value=AbstractSQLSubQuery.class, castRequired=true) public Q with(Path<?> alias, Expression<?> query)
SQLCommonQuery
Usage
query.with(alias, subQuery) .from(...)
with
in interface SQLCommonQuery<Q extends DetachableSQLQuery<Q>>
public WithBuilder<Q> with(Path<?> alias, Path<?>... columns)
SQLCommonQuery
Usage
query.with(alias, columns...).as(subQuery) .from(...)
with
in interface SQLCommonQuery<Q extends DetachableSQLQuery<Q>>
public QueryMetadata getMetadata()
protected abstract SQLSerializer createSerializer()
protected SQLSerializer serialize(boolean forCountRow)
public SQLBindings getSQL(Expression<?>... exprs)
exprs
- Copyright © 2007–2015 Mysema Ltd. All rights reserved.