public abstract class AbstractSQLQuery<Q extends AbstractSQLQuery<Q> & Query> extends ProjectableQuery<Q>
| Modifier and Type | Field and Description |
|---|---|
protected QueryMixin<Q> |
queryMixin |
protected Expression<?> |
union |
protected boolean |
unionAll |
| Constructor and Description |
|---|
AbstractSQLQuery(java.sql.Connection conn,
Configuration configuration) |
AbstractSQLQuery(java.sql.Connection conn,
Configuration configuration,
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,
java.lang.String flag)
Add the given String literal as query flag
|
Q |
addFlag(QueryFlag.Position position,
java.lang.String prefix,
Expression<?> expr)
Add the given prefix and expression as a general query flag
|
Q |
addJoinFlag(java.lang.String flag)
Add the given String literal as a join flag to the last added join with the position
BEFORE_TARGET
|
Q |
addJoinFlag(java.lang.String flag,
JoinFlag.Position position)
Add the given String literal as a join flag to the last added join
|
protected java.lang.String |
buildQueryString(boolean forCountRow) |
long |
count()
return the amount of matched rows
|
protected SQLSerializer |
createSerializer() |
boolean |
exists() |
Q |
forUpdate()
If you use forUpdate() with a backend that uses page or row locks, rows examined by the
query are write-locked until the end of the current transaction.
|
Q |
from(Expression<?>... args) |
Q |
from(Expression<?> arg) |
Q |
from(SubQueryExpression<?> subQuery,
Path<?> alias) |
<E> Q |
fullJoin(ForeignKey<E> key,
RelationalPath<E> entity) |
<E> Q |
fullJoin(RelationalFunctionCall<E> target,
Path<E> alias) |
Q |
fullJoin(RelationalPath<?> target) |
Q |
fullJoin(SubQueryExpression<?> target,
Path<?> alias) |
protected Configuration |
getConfiguration() |
QueryMetadata |
getMetadata() |
java.sql.ResultSet |
getResults(Expression<?>... exprs)
Get the results as an JDBC result set
|
<E> Q |
innerJoin(ForeignKey<E> key,
RelationalPath<E> entity) |
<E> Q |
innerJoin(RelationalFunctionCall<E> target,
Path<E> alias) |
Q |
innerJoin(RelationalPath<?> target) |
Q |
innerJoin(SubQueryExpression<?> target,
Path<?> alias) |
com.mysema.commons.lang.CloseableIterator<Tuple> |
iterate(Expression<?>... args)
iterate over the results for the given projection
|
<RT> com.mysema.commons.lang.CloseableIterator<RT> |
iterate(Expression<RT> expr)
iterate over the results for the given projection
|
<E> Q |
join(ForeignKey<E> key,
RelationalPath<E> entity) |
<E> Q |
join(RelationalFunctionCall<E> target,
Path<E> alias) |
Q |
join(RelationalPath<?> target) |
Q |
join(SubQueryExpression<?> target,
Path<?> alias) |
<E> Q |
leftJoin(ForeignKey<E> key,
RelationalPath<E> entity) |
<E> Q |
leftJoin(RelationalFunctionCall<E> target,
Path<E> alias) |
Q |
leftJoin(RelationalPath<?> target) |
Q |
leftJoin(SubQueryExpression<?> target,
Path<?> alias) |
java.util.List<Tuple> |
list(Expression<?>... args)
list the results for the given projection
An empty list is returned for no results.
|
<RT> java.util.List<RT> |
list(Expression<RT> expr)
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
|
<RT> SearchResults<RT> |
listResults(Expression<RT> expr)
list the results for the given projection
|
Q |
on(Predicate... conditions) |
Q |
on(Predicate condition) |
<E> Q |
rightJoin(ForeignKey<E> key,
RelationalPath<E> entity) |
<E> Q |
rightJoin(RelationalFunctionCall<E> target,
Path<E> alias) |
Q |
rightJoin(RelationalPath<?> target) |
Q |
rightJoin(SubQueryExpression<?> target,
Path<?> alias) |
protected void |
setParameters(java.sql.PreparedStatement stmt,
java.util.List<?> objects,
java.util.List<Path<?>> constantPaths,
java.util.Map<ParamExpression<?>,?> params) |
java.lang.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<?>... expr)
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
|
countDistinct, iterateDistinct, iterateDistinct, listDistinct, listDistinct, listDistinctResults, map, notExists, singleResult, singleResult, transform, uniqueResult@Nullable protected Expression<?> union
protected final QueryMixin<Q extends AbstractSQLQuery<Q> & Query> queryMixin
protected boolean unionAll
public AbstractSQLQuery(@Nullable
java.sql.Connection conn,
Configuration configuration)
public AbstractSQLQuery(@Nullable
java.sql.Connection conn,
Configuration configuration,
QueryMetadata metadata)
public Q addJoinFlag(java.lang.String flag)
flag - public Q addJoinFlag(java.lang.String flag, JoinFlag.Position position)
flag - position - public Q addFlag(QueryFlag.Position position, java.lang.String prefix, Expression<?> expr)
position - position of the flagprefix - prefix for the flagexpr - expression of the flagpublic Q addFlag(QueryFlag.Position position, java.lang.String flag)
position - flag - public Q addFlag(QueryFlag.Position position, Expression<?> flag)
position - flag - protected java.lang.String buildQueryString(boolean forCountRow)
public long count()
Projectablepublic boolean exists()
public Q forUpdate()
protected SQLSerializer createSerializer()
public Q from(Expression<?> arg)
public Q from(Expression<?>... args)
public Q from(SubQueryExpression<?> subQuery, Path<?> alias)
public Q fullJoin(RelationalPath<?> target)
public <E> Q fullJoin(RelationalFunctionCall<E> target, Path<E> alias)
public Q fullJoin(SubQueryExpression<?> target, Path<?> alias)
public <E> Q fullJoin(ForeignKey<E> key, RelationalPath<E> entity)
public Q innerJoin(RelationalPath<?> target)
public <E> Q innerJoin(RelationalFunctionCall<E> target, Path<E> alias)
public Q innerJoin(SubQueryExpression<?> target, Path<?> alias)
public <E> Q innerJoin(ForeignKey<E> key, RelationalPath<E> entity)
public Q join(RelationalPath<?> target)
public <E> Q join(RelationalFunctionCall<E> target, Path<E> alias)
public Q join(SubQueryExpression<?> target, Path<?> alias)
public <E> Q join(ForeignKey<E> key, RelationalPath<E> entity)
public Q leftJoin(RelationalPath<?> target)
public <E> Q leftJoin(RelationalFunctionCall<E> target, Path<E> alias)
public Q leftJoin(SubQueryExpression<?> target, Path<?> alias)
public <E> Q leftJoin(ForeignKey<E> key, RelationalPath<E> entity)
public Q rightJoin(RelationalPath<?> target)
public <E> Q rightJoin(RelationalFunctionCall<E> target, Path<E> alias)
public Q rightJoin(SubQueryExpression<?> target, Path<?> alias)
public <E> Q rightJoin(ForeignKey<E> key, RelationalPath<E> entity)
public QueryMetadata getMetadata()
public java.sql.ResultSet getResults(Expression<?>... exprs)
args - protected Configuration getConfiguration()
public com.mysema.commons.lang.CloseableIterator<Tuple> iterate(Expression<?>... args)
Projectablepublic <RT> com.mysema.commons.lang.CloseableIterator<RT> iterate(Expression<RT> expr)
ProjectableRT - generic type of the Iteratorpublic java.util.List<Tuple> list(Expression<?>... args)
Projectablelist in interface Projectablelist in class ProjectableQuery<Q extends AbstractSQLQuery<Q> & Query>public <RT> java.util.List<RT> list(Expression<RT> expr)
Projectablelist in interface Projectablelist in class ProjectableQuery<Q extends AbstractSQLQuery<Q> & Query>RT - generic type of the Listpublic SearchResults<Tuple> listResults(Expression<?>... args)
Projectablepublic <RT> SearchResults<RT> listResults(Expression<RT> expr)
Projectableprotected void setParameters(java.sql.PreparedStatement stmt,
java.util.List<?> objects,
java.util.List<Path<?>> constantPaths,
java.util.Map<ParamExpression<?>,?> params)
public java.lang.String toString()
public <RT> Union<RT> union(ListSubQuery<RT>... sq)
RT - sq - public <RT> Q union(Path<?> alias, ListSubQuery<RT>... sq)
RT - sq - public <RT> Union<RT> union(SubQueryExpression<RT>... sq)
RT - sq - public <RT> Q union(Path<?> alias, SubQueryExpression<RT>... sq)
RT - sq - public <RT> Union<RT> unionAll(ListSubQuery<RT>... sq)
RT - sq - public <RT> Q unionAll(Path<?> alias, ListSubQuery<RT>... sq)
RT - sq - public <RT> Union<RT> unionAll(SubQueryExpression<RT>... sq)
RT - sq - public <RT> Q unionAll(Path<?> alias, SubQueryExpression<RT>... sq)
RT - sq - public Tuple uniqueResult(Expression<?>... expr)
ProjectableThere is some ambiguity for missing results and null valued results, for disambiguation use the list or iterate methods instead.
public <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.
RT - return typeCopyright © 2007-2013 Mysema Ltd. All Rights Reserved.