Package com.querydsl.sql
Class ProjectableSQLQuery<T,Q extends ProjectableSQLQuery<T,Q> & Query<Q>>
java.lang.Object
com.querydsl.core.support.QueryBase<Q>
com.querydsl.core.support.FetchableQueryBase<T,Q>
com.querydsl.core.support.FetchableSubQueryBase<T,Q>
com.querydsl.sql.ProjectableSQLQuery<T,Q>
- Type Parameters:
T- result typeQ- concrete subtype
- All Implemented Interfaces:
Fetchable<T>,FetchableQuery<T,,Q> FilteredClause<Q>,Query<Q>,SimpleQuery<Q>,ExtendedSubQuery<T>,Expression<T>,SubQueryExpression<T>,SQLCommonQuery<Q>,Serializable
- Direct Known Subclasses:
AbstractSQLQuery
public abstract class ProjectableSQLQuery<T,Q extends ProjectableSQLQuery<T,Q> & Query<Q>>
extends FetchableSubQueryBase<T,Q>
implements SQLCommonQuery<Q>, FetchableQuery<T,Q>
ProjectableSQLQuery is the base type for SQL query implementations- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final Configurationprotected SubQueryExpression<?>protected @Nullable Expression<?>protected booleanFields inherited from class com.querydsl.core.support.QueryBase
MDC_PARAMETERS, MDC_QUERY, queryMixin -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription<R,C> R Add the given query flagaddFlag(QueryFlag.Position position, Expression<?> flag) Add the given Expression as a query flagaddFlag(QueryFlag.Position position, String flag) Add the given String literal as query flagaddFlag(QueryFlag.Position position, String prefix, Expression<?> expr) Add the given prefix and expression as a general query flagaddJoinFlag(String flag) Add the given String literal as a join flag to the last added join with the position BEFORE_TARGETaddJoinFlag(String flag, JoinFlag.Position position) Add the given String literal as a join flag to the last added joinabstract Qclone()protected voidprotected abstract SQLSerializerlongfetchOne()from(Expression<?> arg) from(Expression<?>... args) Defines the sources of the queryfrom(SubQueryExpression<?> subQuery, Path<?> alias) Adds a sub query sourcefullJoin(EntityPath<?> target) Adds a full join to the given target<E> QfullJoin(EntityPath<E> target, Path<E> alias) Adds a full join to the given targetfullJoin(SubQueryExpression<?> target, Path<?> alias) Adds a full join to the given target<E> QfullJoin(ForeignKey<E> key, RelationalPath<E> entity) Adds a full join to the given target<E> QfullJoin(RelationalFunctionCall<E> target, Path<E> alias) Adds a full join to the given targetgetSQL()Get the query as an SQL query string and bindingsprotected SQLBindingsgetSQL(SQLSerializer serializer) innerJoin(EntityPath<?> target) Adds an inner join to the given target<E> QinnerJoin(EntityPath<E> target, Path<E> alias) Adds an inner join to the given targetinnerJoin(SubQueryExpression<?> target, Path<?> alias) Adds an inner join to the given target<E> QinnerJoin(ForeignKey<E> key, RelationalPath<E> entity) Adds an inner join to the given target<E> QinnerJoin(RelationalFunctionCall<E> target, Path<E> alias) Adds a inner join to the given targetjoin(EntityPath<?> target) Adds a join to the given target<E> Qjoin(EntityPath<E> target, Path<E> alias) Adds a join to the given targetjoin(SubQueryExpression<?> target, Path<?> alias) Adds a join to the given target<E> Qjoin(ForeignKey<E> key, RelationalPath<E> entity) Adds a join to the given target<E> Qjoin(RelationalFunctionCall<E> target, Path<E> alias) Adds a join to the given targetleftJoin(EntityPath<?> target) Adds a left join to the given target<E> QleftJoin(EntityPath<E> target, Path<E> alias) Adds a left join to the given targetleftJoin(SubQueryExpression<?> target, Path<?> alias) Adds a left join to the given target<E> QleftJoin(ForeignKey<E> key, RelationalPath<E> entity) Adds a left join to the given target<E> QleftJoin(RelationalFunctionCall<E> target, Path<E> alias) Adds a left join to the given targetDefines a filter to the last added joinrightJoin(EntityPath<?> target) Adds a right join to the given target<E> QrightJoin(EntityPath<E> target, Path<E> alias) Adds a right join to the given targetrightJoin(SubQueryExpression<?> target, Path<?> alias) Adds a right join to the given target<E> QrightJoin(ForeignKey<E> key, RelationalPath<E> entity) Adds a right join to the given target<E> QrightJoin(RelationalFunctionCall<E> target, Path<E> alias) Adds a full join to the given targetprotected SQLSerializerserialize(boolean forCountRow) toString()<RT> Qunion(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>union(List<SubQueryExpression<RT>> sq) Creates an union expression for the given subqueries<RT> QunionAll(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<RT> Union<RT>unionAll(List<SubQueryExpression<RT>> sq) Creates an union expression for the given subquerieswith(Path<?> alias, Expression<?> query) Adds a common table expressionAdds a common table expressionwith(Path<?> alias, SubQueryExpression<?> query) Adds a common table expressionwithRecursive(Path<?> alias, Expression<?> query) Adds a common table expressionwithRecursive(Path<?> alias, Path<?>... columns) Adds a common table expressionwithRecursive(Path<?> alias, SubQueryExpression<?> query) Adds a common table expressionMethods inherited from class com.querydsl.core.support.FetchableSubQueryBase
contains, contains, eq, eq, exists, getMetadata, getType, goe, goe, gt, gt, hashCode, in, in, isNotNull, isNull, loe, loe, lt, lt, ne, ne, notExistsMethods inherited from class com.querydsl.core.support.FetchableQueryBase
equals, fetch, fetchFirst, transform, uniqueResultMethods inherited from class com.querydsl.core.support.QueryBase
distinct, groupBy, groupBy, having, having, limit, offset, orderBy, orderBy, restrict, set, where, whereMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface com.querydsl.core.Fetchable
fetch, fetchFirst, fetchResults, iterate, streamMethods inherited from interface com.querydsl.core.FetchableQuery
select, select, transformMethods inherited from interface com.querydsl.core.FilteredClause
where
-
Field Details
-
configuration
-
union
-
firstUnionSubQuery
-
unionAll
protected boolean unionAll
-
-
Constructor Details
-
ProjectableSQLQuery
-
-
Method Details
-
accept
- Specified by:
acceptin interfaceExpression<T>- Overrides:
acceptin classFetchableSubQueryBase<T,Q extends ProjectableSQLQuery<T, Q> & Query<Q>>
-
addJoinFlag
Add the given String literal as a join flag to the last added join with the position BEFORE_TARGET- Specified by:
addJoinFlagin interfaceSQLCommonQuery<T>- Parameters:
flag- join flag- Returns:
- the current object
-
addJoinFlag
Add the given String literal as a join flag to the last added join- Specified by:
addJoinFlagin interfaceSQLCommonQuery<T>- Parameters:
flag- join flagposition- position- Returns:
- the current object
-
addFlag
Add the given prefix and expression as a general query flag- Specified by:
addFlagin interfaceSQLCommonQuery<T>- Parameters:
position- position of the flagprefix- prefix for the flagexpr- expression of the flag- Returns:
- the current object
-
addFlag
Add the given query flag- Parameters:
flag- query flag- Returns:
- the current object
-
addFlag
Add the given String literal as query flag- Specified by:
addFlagin interfaceSQLCommonQuery<T>- Parameters:
position- positionflag- query flag- Returns:
- the current object
-
addFlag
Add the given Expression as a query flag- Specified by:
addFlagin interfaceSQLCommonQuery<T>- Parameters:
position- positionflag- query flag- Returns:
- the current object
-
fetchCount
public long fetchCount()- Specified by:
fetchCountin interfaceFetchable<T>
-
from
-
from
Description copied from interface:SQLCommonQueryDefines the sources of the query- Specified by:
fromin interfaceSQLCommonQuery<T>- Parameters:
args- from- Returns:
- the current object
-
from
Description copied from interface:SQLCommonQueryAdds a sub query source- Specified by:
fromin interfaceSQLCommonQuery<T>- Parameters:
subQuery- sub queryalias- alias- Returns:
- the current object
-
fullJoin
Description copied from interface:SQLCommonQueryAdds a full join to the given target- Specified by:
fullJoinin interfaceSQLCommonQuery<T>- Parameters:
target- full join target- Returns:
- the current object
-
fullJoin
Description copied from interface:SQLCommonQueryAdds a full join to the given target- Specified by:
fullJoinin interfaceSQLCommonQuery<T>- Parameters:
target- full join targetalias- alias- Returns:
- the current object
-
fullJoin
Description copied from interface:SQLCommonQueryAdds a full join to the given target- Specified by:
fullJoinin interfaceSQLCommonQuery<T>- Parameters:
target- full join targetalias- alias- Returns:
- the current object
-
fullJoin
Description copied from interface:SQLCommonQueryAdds a full join to the given target- Specified by:
fullJoinin interfaceSQLCommonQuery<T>- Parameters:
target- subqueryalias- alias- Returns:
- the current object
-
fullJoin
Description copied from interface:SQLCommonQueryAdds a full join to the given target- Specified by:
fullJoinin interfaceSQLCommonQuery<T>- Parameters:
key- foreign key for joinentity- join target- Returns:
- the current object
-
innerJoin
Description copied from interface:SQLCommonQueryAdds an inner join to the given target- Specified by:
innerJoinin interfaceSQLCommonQuery<T>- Returns:
- the current object
-
innerJoin
Description copied from interface:SQLCommonQueryAdds an inner join to the given target- Specified by:
innerJoinin interfaceSQLCommonQuery<T>- Parameters:
target- inner join targetalias- alias- Returns:
- the current object
-
innerJoin
Description copied from interface:SQLCommonQueryAdds a inner join to the given target- Specified by:
innerJoinin interfaceSQLCommonQuery<T>- Parameters:
target- relational function callalias- alias- Returns:
- the current object
-
innerJoin
Description copied from interface:SQLCommonQueryAdds an inner join to the given target- Specified by:
innerJoinin interfaceSQLCommonQuery<T>- Parameters:
target- subqueryalias- alias- Returns:
- the current object
-
innerJoin
Description copied from interface:SQLCommonQueryAdds an inner join to the given target- Specified by:
innerJoinin interfaceSQLCommonQuery<T>- Parameters:
key- foreign key to use for joinentity- join target- Returns:
- the current object
-
join
Description copied from interface:SQLCommonQueryAdds a join to the given target- Specified by:
joinin interfaceSQLCommonQuery<T>- Parameters:
target- join target- Returns:
- the current object
-
join
Description copied from interface:SQLCommonQueryAdds a join to the given target- Specified by:
joinin interfaceSQLCommonQuery<T>- Parameters:
target- join targetalias- alias- Returns:
- the current object
-
join
Description copied from interface:SQLCommonQueryAdds a join to the given target- Specified by:
joinin interfaceSQLCommonQuery<T>- Parameters:
target- join targetalias- alias- Returns:
- the current object
-
join
Description copied from interface:SQLCommonQueryAdds a join to the given target- Specified by:
joinin interfaceSQLCommonQuery<T>- Parameters:
target- subqueryalias- alias- Returns:
- the current object
-
join
Description copied from interface:SQLCommonQueryAdds a join to the given target- Specified by:
joinin interfaceSQLCommonQuery<T>- Parameters:
key- foreign key to use for joinentity- join target- Returns:
- the current object
-
leftJoin
Description copied from interface:SQLCommonQueryAdds a left join to the given target- Specified by:
leftJoinin interfaceSQLCommonQuery<T>- Parameters:
target- join target- Returns:
- the current object
-
leftJoin
Description copied from interface:SQLCommonQueryAdds a left join to the given target- Specified by:
leftJoinin interfaceSQLCommonQuery<T>- Parameters:
target- left join targetalias- alias- Returns:
- the current object
-
leftJoin
Description copied from interface:SQLCommonQueryAdds a left join to the given target- Specified by:
leftJoinin interfaceSQLCommonQuery<T>- Parameters:
target- relational function callalias- alias- Returns:
- the current object
-
leftJoin
Description copied from interface:SQLCommonQueryAdds a left join to the given target- Specified by:
leftJoinin interfaceSQLCommonQuery<T>- Parameters:
target- subqueryalias- alias- Returns:
- the current object
-
leftJoin
Description copied from interface:SQLCommonQueryAdds a left join to the given target- Specified by:
leftJoinin interfaceSQLCommonQuery<T>- Parameters:
key- foreign key to use for joinentity- join target- Returns:
- the current object
-
rightJoin
Description copied from interface:SQLCommonQueryAdds a right join to the given target- Specified by:
rightJoinin interfaceSQLCommonQuery<T>- Parameters:
target- join target- Returns:
- the current object
-
rightJoin
Description copied from interface:SQLCommonQueryAdds a right join to the given target- Specified by:
rightJoinin interfaceSQLCommonQuery<T>- Parameters:
target- right join targetalias- alias- Returns:
- the current object
-
rightJoin
Description copied from interface:SQLCommonQueryAdds a full join to the given target- Specified by:
rightJoinin interfaceSQLCommonQuery<T>- Parameters:
target- relational function callalias- alias- Returns:
- the current object
-
rightJoin
Description copied from interface:SQLCommonQueryAdds a right join to the given target- Specified by:
rightJoinin interfaceSQLCommonQuery<T>- Parameters:
target- subqueryalias- alias- Returns:
- the current object
-
rightJoin
Description copied from interface:SQLCommonQueryAdds a right join to the given target- Specified by:
rightJoinin interfaceSQLCommonQuery<T>- Parameters:
key- foreign key to use for joinentity- join target- Returns:
- the current object
-
on
-
on
Description copied from interface:SQLCommonQueryDefines a filter to the last added join- Specified by:
onin interfaceSQLCommonQuery<T>- Parameters:
conditions- join conditions- Returns:
- the current object
-
union
Creates an union expression for the given subqueries- Type Parameters:
RT-- Parameters:
sq- subqueries- Returns:
- union
-
union
Creates an union expression for the given subqueries- Type Parameters:
RT-- Parameters:
sq- subqueries- Returns:
- union
-
union
Creates an union expression for the given subqueries- Type Parameters:
RT-- Parameters:
alias- alias for unionsq- subqueries- Returns:
- the current object
-
unionAll
Creates an union expression for the given subqueries- Type Parameters:
RT-- Parameters:
sq- subqueries- Returns:
- union
-
unionAll
Creates an union expression for the given subqueries- Type Parameters:
RT-- Parameters:
sq- subqueries- Returns:
- union
-
unionAll
Creates an union expression for the given subqueries- Type Parameters:
RT-- Parameters:
alias- alias for unionsq- subqueries- Returns:
- the current object
-
fetchOne
- Specified by:
fetchOnein interfaceFetchable<T>- Throws:
NonUniqueResultException
-
withRecursive
Description copied from interface:SQLCommonQueryAdds a common table expressionUsage
query.withRecursive(alias, subQuery) .from(...)- Specified by:
withRecursivein interfaceSQLCommonQuery<T>- Parameters:
alias- alias for queryquery- subquery- Returns:
- the current object
-
withRecursive
Description copied from interface:SQLCommonQueryAdds a common table expressionUsage
query.withRecursive(alias, subQuery) .from(...)- Specified by:
withRecursivein interfaceSQLCommonQuery<T>- Parameters:
alias- alias for queryquery- subquery- Returns:
- the current object
-
withRecursive
Description copied from interface:SQLCommonQueryAdds a common table expressionUsage
query.withRecursive(alias, columns...).as(subQuery) .from(...)- Specified by:
withRecursivein interfaceSQLCommonQuery<T>- Parameters:
alias- alias for querycolumns- columns to use- Returns:
- builder for with part
-
with
Description copied from interface:SQLCommonQueryAdds a common table expressionUsage
query.with(alias, subQuery) .from(...)- Specified by:
within interfaceSQLCommonQuery<T>- Parameters:
alias- alias for queryquery- subquery- Returns:
- the current object
-
with
Description copied from interface:SQLCommonQueryAdds a common table expressionUsage
query.with(alias, subQuery) .from(...)- Specified by:
within interfaceSQLCommonQuery<T>- Parameters:
alias- alias for queryquery- subquery- Returns:
- the current object
-
with
Description copied from interface:SQLCommonQueryAdds a common table expressionUsage
query.with(alias, columns...).as(subQuery) .from(...)- Specified by:
within interfaceSQLCommonQuery<T>- Parameters:
alias- alias for querycolumns- columns to use- Returns:
- the current object
-
clone
-
clone
-
createSerializer
-
serialize
-
getSQL
Get the query as an SQL query string and bindings- Returns:
- SQL string and bindings
-
getSQL
-
toString
-