Q - concrete subtypepublic abstract class ProjectableSQLQuery<Q extends ProjectableSQLQuery<Q> & Query<Q>> extends ProjectableQuery<Q> implements SQLCommonQuery<Q>
| Modifier and Type | Field and Description |
|---|---|
protected Configuration |
configuration |
protected SubQueryExpression<?> |
firstUnionSubQuery |
protected Expression<?> |
union |
protected boolean |
unionAll |
MDC_PARAMETERS, MDC_QUERY, queryMixin| Constructor and Description |
|---|
ProjectableSQLQuery(QueryMixin<Q> queryMixin,
Configuration configuration) |
| 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 query flag
|
Q |
addFlag(QueryFlag.Position position,
String prefix,
Expression<?> expr)
Add the given prefix and expression as a general query flag
|
Q |
addFlag(QueryFlag flag)
Add the given 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 void |
clone(Q query) |
long |
count()
return the amount of matched rows
|
protected abstract SQLSerializer |
createSerializer() |
boolean |
exists() |
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
|
com.mysema.commons.lang.CloseableIterator<Tuple> |
iterate(Expression<?>... args)
iterate over the results for the given projection
|
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
|
List<Tuple> |
list(Expression<?>... args)
list the results for the given projection
An empty list is returned for no results.
|
SearchResults<Tuple> |
listResults(Expression<?>... args)
list the results for the given projection
|
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() |
<RT> Union<RT> |
union(ListSubQuery<RT>... sq)
Creates an union expression for the given subqueries
|
<RT> Q |
union(Path<?> alias,
ListSubQuery<RT>... sq)
Creates an union expression for the given subqueries
|
<RT> Q |
union(Path<?> alias,
SubQueryExpression<RT>... sq)
Creates an union expression for the given subqueries
|
<RT> Union<RT> |
union(SubQueryExpression<RT>... sq)
Creates an union expression for the given subqueries
|
<RT> Union<RT> |
unionAll(ListSubQuery<RT>... sq)
Creates an union expression for the given subqueries
|
<RT> Q |
unionAll(Path<?> alias,
ListSubQuery<RT>... sq)
Creates an union expression for the given subqueries
|
<RT> Q |
unionAll(Path<?> alias,
SubQueryExpression<RT>... sq)
Creates an union expression for the given subqueries
|
<RT> Union<RT> |
unionAll(SubQueryExpression<RT>... sq)
Creates an union expression for the given subqueries
|
Tuple |
uniqueResult(Expression<?>... args)
return a unique result for the given projection or null if no result is found
|
<RT> RT |
uniqueResult(Expression<RT> expr)
return a unique result for the given projection or null if no result is found
|
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<?> query)
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
|
list, map, notExists, singleResult, singleResult, transform, uniqueResultdistinct, equals, groupBy, groupBy, hashCode, having, having, limit, offset, orderBy, orderBy, restrict, set, where, wherefinalize, getClass, notify, notifyAll, wait, wait, waitdistinct, limit, offset, orderBy, restrict, setwhereiterate, listResultsprotected final Configuration configuration
@Nullable protected Expression<?> union
protected SubQueryExpression<?> firstUnionSubQuery
protected boolean unionAll
public ProjectableSQLQuery(QueryMixin<Q> queryMixin, Configuration configuration)
@WithBridgeMethods(value=AbstractSQLQuery.class, castRequired=true) public Q addJoinFlag(String flag)
addJoinFlag in interface SQLCommonQuery<Q extends ProjectableSQLQuery<Q> & Query<Q>>flag - @WithBridgeMethods(value=AbstractSQLQuery.class, castRequired=true) public Q addJoinFlag(String flag, JoinFlag.Position position)
addJoinFlag in interface SQLCommonQuery<Q extends ProjectableSQLQuery<Q> & Query<Q>>flag - position - @WithBridgeMethods(value=AbstractSQLQuery.class, castRequired=true) public Q addFlag(QueryFlag.Position position, String prefix, Expression<?> expr)
addFlag in interface SQLCommonQuery<Q extends ProjectableSQLQuery<Q> & Query<Q>>position - position of the flagprefix - prefix for the flagexpr - expression of the flag@WithBridgeMethods(value=AbstractSQLQuery.class, castRequired=true) public Q addFlag(QueryFlag flag)
flag - @WithBridgeMethods(value=AbstractSQLQuery.class, castRequired=true) public Q addFlag(QueryFlag.Position position, String flag)
addFlag in interface SQLCommonQuery<Q extends ProjectableSQLQuery<Q> & Query<Q>>position - flag - @WithBridgeMethods(value=AbstractSQLQuery.class, castRequired=true) public Q addFlag(QueryFlag.Position position, Expression<?> flag)
addFlag in interface SQLCommonQuery<Q extends ProjectableSQLQuery<Q> & Query<Q>>position - flag - public long count()
Projectablecount in interface Projectablepublic boolean exists()
exists in interface Projectable@WithBridgeMethods(value=AbstractSQLQuery.class, castRequired=true) public Q from(Expression<?> arg)
@WithBridgeMethods(value=AbstractSQLQuery.class, castRequired=true) public Q from(Expression<?>... args)
SQLCommonQueryfrom in interface SQLCommonQuery<Q extends ProjectableSQLQuery<Q> & Query<Q>>@WithBridgeMethods(value=AbstractSQLQuery.class, castRequired=true) public Q from(SubQueryExpression<?> subQuery, Path<?> alias)
SQLCommonQueryfrom in interface SQLCommonQuery<Q extends ProjectableSQLQuery<Q> & Query<Q>>@WithBridgeMethods(value=AbstractSQLQuery.class, castRequired=true) public Q fullJoin(EntityPath<?> target)
SQLCommonQueryfullJoin in interface SQLCommonQuery<Q extends ProjectableSQLQuery<Q> & Query<Q>>@WithBridgeMethods(value=AbstractSQLQuery.class, castRequired=true) public <E> Q fullJoin(RelationalFunctionCall<E> target, Path<E> alias)
SQLCommonQueryfullJoin in interface SQLCommonQuery<Q extends ProjectableSQLQuery<Q> & Query<Q>>@WithBridgeMethods(value=AbstractSQLQuery.class, castRequired=true) public Q fullJoin(SubQueryExpression<?> target, Path<?> alias)
SQLCommonQueryfullJoin in interface SQLCommonQuery<Q extends ProjectableSQLQuery<Q> & Query<Q>>@WithBridgeMethods(value=AbstractSQLQuery.class, castRequired=true) public <E> Q fullJoin(ForeignKey<E> key, RelationalPath<E> entity)
SQLCommonQueryfullJoin in interface SQLCommonQuery<Q extends ProjectableSQLQuery<Q> & Query<Q>>@WithBridgeMethods(value=AbstractSQLQuery.class, castRequired=true) public Q innerJoin(EntityPath<?> target)
SQLCommonQueryinnerJoin in interface SQLCommonQuery<Q extends ProjectableSQLQuery<Q> & Query<Q>>@WithBridgeMethods(value=AbstractSQLQuery.class, castRequired=true) public <E> Q innerJoin(RelationalFunctionCall<E> target, Path<E> alias)
SQLCommonQueryinnerJoin in interface SQLCommonQuery<Q extends ProjectableSQLQuery<Q> & Query<Q>>@WithBridgeMethods(value=AbstractSQLQuery.class, castRequired=true) public Q innerJoin(SubQueryExpression<?> target, Path<?> alias)
SQLCommonQueryinnerJoin in interface SQLCommonQuery<Q extends ProjectableSQLQuery<Q> & Query<Q>>@WithBridgeMethods(value=AbstractSQLQuery.class, castRequired=true) public <E> Q innerJoin(ForeignKey<E> key, RelationalPath<E> entity)
SQLCommonQueryinnerJoin in interface SQLCommonQuery<Q extends ProjectableSQLQuery<Q> & Query<Q>>@WithBridgeMethods(value=AbstractSQLQuery.class, castRequired=true) public Q join(EntityPath<?> target)
SQLCommonQueryjoin in interface SQLCommonQuery<Q extends ProjectableSQLQuery<Q> & Query<Q>>@WithBridgeMethods(value=AbstractSQLQuery.class, castRequired=true) public <E> Q join(RelationalFunctionCall<E> target, Path<E> alias)
SQLCommonQueryjoin in interface SQLCommonQuery<Q extends ProjectableSQLQuery<Q> & Query<Q>>@WithBridgeMethods(value=AbstractSQLQuery.class, castRequired=true) public Q join(SubQueryExpression<?> target, Path<?> alias)
SQLCommonQueryjoin in interface SQLCommonQuery<Q extends ProjectableSQLQuery<Q> & Query<Q>>@WithBridgeMethods(value=AbstractSQLQuery.class, castRequired=true) public <E> Q join(ForeignKey<E> key, RelationalPath<E> entity)
SQLCommonQueryjoin in interface SQLCommonQuery<Q extends ProjectableSQLQuery<Q> & Query<Q>>@WithBridgeMethods(value=AbstractSQLQuery.class, castRequired=true) public Q leftJoin(EntityPath<?> target)
SQLCommonQueryleftJoin in interface SQLCommonQuery<Q extends ProjectableSQLQuery<Q> & Query<Q>>@WithBridgeMethods(value=AbstractSQLQuery.class, castRequired=true) public <E> Q leftJoin(RelationalFunctionCall<E> target, Path<E> alias)
SQLCommonQueryleftJoin in interface SQLCommonQuery<Q extends ProjectableSQLQuery<Q> & Query<Q>>@WithBridgeMethods(value=AbstractSQLQuery.class, castRequired=true) public Q leftJoin(SubQueryExpression<?> target, Path<?> alias)
SQLCommonQueryleftJoin in interface SQLCommonQuery<Q extends ProjectableSQLQuery<Q> & Query<Q>>@WithBridgeMethods(value=AbstractSQLQuery.class, castRequired=true) public <E> Q leftJoin(ForeignKey<E> key, RelationalPath<E> entity)
SQLCommonQueryleftJoin in interface SQLCommonQuery<Q extends ProjectableSQLQuery<Q> & Query<Q>>@WithBridgeMethods(value=AbstractSQLQuery.class, castRequired=true) public Q rightJoin(EntityPath<?> target)
SQLCommonQueryrightJoin in interface SQLCommonQuery<Q extends ProjectableSQLQuery<Q> & Query<Q>>@WithBridgeMethods(value=AbstractSQLQuery.class, castRequired=true) public <E> Q rightJoin(RelationalFunctionCall<E> target, Path<E> alias)
SQLCommonQueryrightJoin in interface SQLCommonQuery<Q extends ProjectableSQLQuery<Q> & Query<Q>>@WithBridgeMethods(value=AbstractSQLQuery.class, castRequired=true) public Q rightJoin(SubQueryExpression<?> target, Path<?> alias)
SQLCommonQueryrightJoin in interface SQLCommonQuery<Q extends ProjectableSQLQuery<Q> & Query<Q>>@WithBridgeMethods(value=AbstractSQLQuery.class, castRequired=true) public <E> Q rightJoin(ForeignKey<E> key, RelationalPath<E> entity)
SQLCommonQueryrightJoin in interface SQLCommonQuery<Q extends ProjectableSQLQuery<Q> & Query<Q>>public QueryMetadata getMetadata()
public com.mysema.commons.lang.CloseableIterator<Tuple> iterate(Expression<?>... args)
Projectableiterate in interface Projectablepublic List<Tuple> list(Expression<?>... args)
Projectablelist in interface Projectablelist in class ProjectableQuery<Q extends ProjectableSQLQuery<Q> & Query<Q>>public SearchResults<Tuple> listResults(Expression<?>... args)
ProjectablelistResults in interface Projectable@WithBridgeMethods(value=AbstractSQLQuery.class, castRequired=true) public Q on(Predicate condition)
@WithBridgeMethods(value=AbstractSQLQuery.class, castRequired=true) public Q on(Predicate... conditions)
SQLCommonQueryon in interface SQLCommonQuery<Q extends ProjectableSQLQuery<Q> & Query<Q>>public <RT> Union<RT> union(ListSubQuery<RT>... sq)
RT - sq - @WithBridgeMethods(value=AbstractSQLQuery.class, castRequired=true) public <RT> Q union(Path<?> alias, ListSubQuery<RT>... sq)
RT - sq - public <RT> Union<RT> union(SubQueryExpression<RT>... sq)
RT - sq - @WithBridgeMethods(value=AbstractSQLQuery.class, castRequired=true) public <RT> Q union(Path<?> alias, SubQueryExpression<RT>... sq)
RT - sq - public <RT> Union<RT> unionAll(ListSubQuery<RT>... sq)
RT - sq - @WithBridgeMethods(value=AbstractSQLQuery.class, castRequired=true) public <RT> Q unionAll(Path<?> alias, ListSubQuery<RT>... sq)
RT - sq - public <RT> Union<RT> unionAll(SubQueryExpression<RT>... sq)
RT - sq - @WithBridgeMethods(value=AbstractSQLQuery.class, castRequired=true) public <RT> Q unionAll(Path<?> alias, SubQueryExpression<RT>... sq)
RT - sq - public Tuple uniqueResult(Expression<?>... args)
ProjectableThere is some ambiguity for missing results and null valued results, for disambiguation use the list or iterate methods instead.
uniqueResult in interface Projectablepublic <RT> RT uniqueResult(Expression<RT> expr)
ProjectableThere is some ambiguity for missing results and null valued results, for disambiguation use the list or iterate methods instead.
uniqueResult in interface ProjectableRT - return type@WithBridgeMethods(value=AbstractSQLQuery.class, castRequired=true) public Q withRecursive(Path<?> alias, SubQueryExpression<?> query)
SQLCommonQueryUsage
query.withRecursive(alias, subQuery)
.from(...)
withRecursive in interface SQLCommonQuery<Q extends ProjectableSQLQuery<Q> & Query<Q>>@WithBridgeMethods(value=AbstractSQLQuery.class, castRequired=true) public Q withRecursive(Path<?> alias, Expression<?> query)
SQLCommonQueryUsage
query.withRecursive(alias, subQuery)
.from(...)
withRecursive in interface SQLCommonQuery<Q extends ProjectableSQLQuery<Q> & Query<Q>>public WithBuilder<Q> withRecursive(Path<?> alias, Path<?>... columns)
SQLCommonQueryUsage
query.withRecursive(alias, columns...).as(subQuery)
.from(...)
withRecursive in interface SQLCommonQuery<Q extends ProjectableSQLQuery<Q> & Query<Q>>@WithBridgeMethods(value=AbstractSQLQuery.class, castRequired=true) public Q with(Path<?> alias, SubQueryExpression<?> query)
SQLCommonQueryUsage
query.with(alias, subQuery)
.from(...)
with in interface SQLCommonQuery<Q extends ProjectableSQLQuery<Q> & Query<Q>>@WithBridgeMethods(value=AbstractSQLQuery.class, castRequired=true) public Q with(Path<?> alias, Expression<?> query)
SQLCommonQueryUsage
query.with(alias, subQuery)
.from(...)
with in interface SQLCommonQuery<Q extends ProjectableSQLQuery<Q> & Query<Q>>public WithBuilder<Q> with(Path<?> alias, Path<?>... columns)
SQLCommonQueryUsage
query.with(alias, columns...).as(subQuery)
.from(...)
with in interface SQLCommonQuery<Q extends ProjectableSQLQuery<Q> & Query<Q>>protected void clone(Q query)
protected abstract SQLSerializer createSerializer()
protected SQLSerializer serialize(boolean forCountRow)
public SQLBindings getSQL(Expression<?>... exprs)
exprs - Copyright © 2007–2015 Querydsl. All rights reserved.