T
- The query result typeX
- The concrete builder typepublic interface BaseQueryBuilder<T,X extends BaseQueryBuilder<T,X>> extends WhereBuilder<X>, OrderByBuilder<X>, SelectBuilder<T,X>
Modifier and Type | Method and Description |
---|---|
KeysetBuilder<X> |
afterKeyset()
Uses the keyset which the keyset builder constructed to filter out rows that come before the keyset.
|
X |
afterKeyset(Keyset keyset)
Like
afterKeyset(java.io.Serializable...) but uses the given keyset as reference values. |
X |
afterKeyset(Serializable... values)
Like
afterKeyset() but maps the reference values by position instead of by expression. |
KeysetBuilder<X> |
beforeKeyset()
Uses the keyset which the keyset builder constructed to filter out rows that come after the keyset.
|
X |
beforeKeyset(Keyset keyset)
Like
beforeKeyset(java.io.Serializable...) but uses the given keyset as reference values. |
X |
beforeKeyset(Serializable... values)
Like
beforeKeyset() but maps the reference values by position instead of by expression. |
BaseQueryBuilder<T,?> |
from(Class<?> entityClass)
Like
from(java.lang.Class, java.lang.String) with the
alias equivalent to the camel cased result of what Class.getSimpleName() of the entity class returns. |
BaseQueryBuilder<T,?> |
from(Class<?> entityClass,
String alias)
Sets the entity class on which the query should be based on with the given alias.
|
String |
getQueryString()
Returns the query string for the built query.
|
Class<T> |
getResultType()
Returns the result type of this query.
|
X |
innerJoin(String path,
String alias)
|
X |
innerJoinDefault(String path,
String alias)
|
JoinOnBuilder<X> |
innerJoinDefaultOn(String path,
String alias)
|
JoinOnBuilder<X> |
innerJoinOn(String path,
String alias)
|
X |
join(String path,
String alias,
JoinType type)
Adds a join to the query, possibly specializing implicit joins, and giving the joined element an alias.
|
X |
joinDefault(String path,
String alias,
JoinType type)
Adds a join to the query, possibly specializing implicit joins, and giving the joined element an alias.
|
JoinOnBuilder<X> |
joinDefaultOn(String path,
String alias,
JoinType type)
Adds a join with an on-clause to the query, possibly specializing implicit joins, and giving the joined element an alias.
|
JoinOnBuilder<X> |
joinOn(String path,
String alias,
JoinType type)
Adds a join with an on-clause to the query, possibly specializing implicit joins, and giving the joined element an alias.
|
X |
leftJoin(String path,
String alias)
|
X |
leftJoinDefault(String path,
String alias)
|
JoinOnBuilder<X> |
leftJoinDefaultOn(String path,
String alias)
|
JoinOnBuilder<X> |
leftJoinOn(String path,
String alias)
|
X |
rightJoin(String path,
String alias)
|
X |
rightJoinDefault(String path,
String alias)
|
JoinOnBuilder<X> |
rightJoinDefaultOn(String path,
String alias)
|
JoinOnBuilder<X> |
rightJoinOn(String path,
String alias)
|
BaseQueryBuilder<T,?> |
select(String expression)
Adds a select clause with the given expression to the query.
|
BaseQueryBuilder<T,?> |
select(String expression,
String alias)
Adds a select clause with the given expression and alias to the query.
|
CaseWhenStarterBuilder<? extends BaseQueryBuilder<T,?>> |
selectCase()
Like
SelectBuilder.selectCase(java.lang.String) but without an alias. |
CaseWhenStarterBuilder<? extends BaseQueryBuilder<T,?>> |
selectCase(String alias)
Starts a
CaseWhenBuilder with the given alias as select alias. |
SimpleCaseWhenStarterBuilder<? extends BaseQueryBuilder<T,?>> |
selectSimpleCase(String expression)
Like
SelectBuilder.selectSimpleCase(java.lang.String, java.lang.String) but without an alias. |
SimpleCaseWhenStarterBuilder<? extends BaseQueryBuilder<T,?>> |
selectSimpleCase(String expression,
String alias)
Starts a
SimpleCaseWhenBuilder with the given alias as select alias. |
SubqueryInitiator<? extends BaseQueryBuilder<T,?>> |
selectSubquery()
Like
SelectBuilder.selectSubquery(java.lang.String) but without an alias. |
SubqueryInitiator<? extends BaseQueryBuilder<T,?>> |
selectSubquery(String alias)
Starts a
SubqueryInitiator for the select item with the given alias. |
SubqueryInitiator<? extends BaseQueryBuilder<T,?>> |
selectSubquery(String subqueryAlias,
String expression)
Like
SelectBuilder.selectSubquery(java.lang.String,java.lang.String,java.lang.String) but without a select alias. |
SubqueryInitiator<? extends BaseQueryBuilder<T,?>> |
selectSubquery(String subqueryAlias,
String expression,
String selectAlias)
Starts a
SubqueryInitiator for a new select item with the given select alias. |
whereOr
where, whereCase, whereExists, whereNotExists, whereSimpleCase, whereSubquery, whereSubquery
orderBy, orderByAsc, orderByAsc, orderByDesc, orderByDesc
BaseQueryBuilder<T,?> from(Class<?> entityClass)
from(java.lang.Class, java.lang.String)
with the
alias equivalent to the camel cased result of what Class.getSimpleName()
of the entity class returns.entityClass
- The entity class which should be the root entityBaseQueryBuilder<T,?> from(Class<?> entityClass, String alias)
entityClass
- The entity class which should be the root entityalias
- The alias for the root entityClass<T> getResultType()
String getQueryString()
KeysetBuilder<X> beforeKeyset()
X beforeKeyset(Serializable... values)
beforeKeyset()
but maps the reference values by position instead of by expression.
The order of the reference values has to match the order of the order by expressions.values
- The reference valuesX beforeKeyset(Keyset keyset)
beforeKeyset(java.io.Serializable...)
but uses the given keyset as reference values.
The order of the tuple values has to match the order of the order by expressions.keyset
- The reference keysetKeysetBuilder<X> afterKeyset()
X afterKeyset(Serializable... values)
afterKeyset()
but maps the reference values by position instead of by expression.
The order of the reference values has to match the order of the order by expressions.values
- The reference valuesX afterKeyset(Keyset keyset)
afterKeyset(java.io.Serializable...)
but uses the given keyset as reference values.
The order of the tuple values has to match the order of the order by expressions.keyset
- The reference keysetX join(String path, String alias, JoinType type)
path
- The path to joinalias
- The alias for the joined elementtype
- The join typeX joinDefault(String path, String alias, JoinType type)
path
- The path to joinalias
- The alias for the joined elementtype
- The join typeJoinOnBuilder<X> joinOn(String path, String alias, JoinType type)
The resulting join is different from a default join because it can only be referred to via it's alias. The absolute path can only be used if the joined path is a map and the on-clause contains a EQ predicate with the KEY on the left hand side.
path
- The path to joinalias
- The alias for the joined elementtype
- The join typeJoinOnBuilder<X> joinDefaultOn(String path, String alias, JoinType type)
path
- The path to joinalias
- The alias for the joined elementtype
- The join typeX innerJoin(String path, String alias)
join(java.lang.String, java.lang.String, com.blazebit.persistence.JoinType)
but with
JoinType.INNER
.path
- The path to joinalias
- The alias for the joined elementX innerJoinDefault(String path, String alias)
joinDefault(java.lang.String, java.lang.String, com.blazebit.persistence.JoinType)
but with
JoinType.INNER
.path
- The path to joinalias
- The alias for the joined elementJoinOnBuilder<X> innerJoinOn(String path, String alias)
joinOn(java.lang.String, java.lang.String, com.blazebit.persistence.JoinType)
but with
JoinType.INNER
.path
- The path to joinalias
- The alias for the joined elementJoinOnBuilder<X> innerJoinDefaultOn(String path, String alias)
joinDefaultOn(java.lang.String, java.lang.String, com.blazebit.persistence.JoinType)
but with
JoinType.INNER
.path
- The path to joinalias
- The alias for the joined elementX leftJoin(String path, String alias)
join(java.lang.String, java.lang.String, com.blazebit.persistence.JoinType)
but with
JoinType.LEFT
.path
- The path to joinalias
- The alias for the joined elementX leftJoinDefault(String path, String alias)
joinDefault(java.lang.String, java.lang.String, com.blazebit.persistence.JoinType)
but with
JoinType.LEFT
.path
- The path to joinalias
- The alias for the joined elementJoinOnBuilder<X> leftJoinOn(String path, String alias)
joinOn(java.lang.String, java.lang.String, com.blazebit.persistence.JoinType)
but with
JoinType.LEFT
.path
- The path to joinalias
- The alias for the joined elementJoinOnBuilder<X> leftJoinDefaultOn(String path, String alias)
joinDefaultOn(java.lang.String, java.lang.String, com.blazebit.persistence.JoinType)
but with
JoinType.LEFT
.path
- The path to joinalias
- The alias for the joined elementX rightJoin(String path, String alias)
join(java.lang.String, java.lang.String, com.blazebit.persistence.JoinType)
but with
JoinType.RIGHT
.path
- The path to joinalias
- The alias for the joined elementX rightJoinDefault(String path, String alias)
joinDefault(java.lang.String, java.lang.String, com.blazebit.persistence.JoinType)
but with
JoinType.RIGHT
.path
- The path to joinalias
- The alias for the joined elementJoinOnBuilder<X> rightJoinOn(String path, String alias)
joinOn(java.lang.String, java.lang.String, com.blazebit.persistence.JoinType)
but with
JoinType.RIGHT
.path
- The path to joinalias
- The alias for the joined elementJoinOnBuilder<X> rightJoinDefaultOn(String path, String alias)
joinDefaultOn(java.lang.String, java.lang.String, com.blazebit.persistence.JoinType)
but with
JoinType.RIGHT
.path
- The path to joinalias
- The alias for the joined elementCaseWhenStarterBuilder<? extends BaseQueryBuilder<T,?>> selectCase()
SelectBuilder
SelectBuilder.selectCase(java.lang.String)
but without an alias.selectCase
in interface SelectBuilder<T,X extends BaseQueryBuilder<T,X>>
CaseWhenStarterBuilder<? extends BaseQueryBuilder<T,?>> selectCase(String alias)
SelectBuilder
CaseWhenBuilder
with the given alias as select alias.selectCase
in interface SelectBuilder<T,X extends BaseQueryBuilder<T,X>>
alias
- The select alias for the case when expressionSimpleCaseWhenStarterBuilder<? extends BaseQueryBuilder<T,?>> selectSimpleCase(String expression)
SelectBuilder
SelectBuilder.selectSimpleCase(java.lang.String, java.lang.String)
but without an alias.selectSimpleCase
in interface SelectBuilder<T,X extends BaseQueryBuilder<T,X>>
expression
- The case operandSimpleCaseWhenStarterBuilder<? extends BaseQueryBuilder<T,?>> selectSimpleCase(String expression, String alias)
SelectBuilder
SimpleCaseWhenBuilder
with the given alias as select alias.
The expression is the case operand which will be compared to the when expressions defined in the subsequent SimpleCaseWhenBuilder.selectSimpleCase
in interface SelectBuilder<T,X extends BaseQueryBuilder<T,X>>
expression
- The case operandalias
- The select alias for the simple case when expressionBaseQueryBuilder<T,?> select(String expression)
SelectBuilder
select
in interface SelectBuilder<T,X extends BaseQueryBuilder<T,X>>
expression
- The expression for the select clauseBaseQueryBuilder<T,?> select(String expression, String alias)
SelectBuilder
select
in interface SelectBuilder<T,X extends BaseQueryBuilder<T,X>>
expression
- The expression for the select clausealias
- The alias for the expressionSubqueryInitiator<? extends BaseQueryBuilder<T,?>> selectSubquery()
SelectBuilder
SelectBuilder.selectSubquery(java.lang.String)
but without an alias.selectSubquery
in interface SelectBuilder<T,X extends BaseQueryBuilder<T,X>>
SubqueryInitiator<? extends BaseQueryBuilder<T,?>> selectSubquery(String alias)
SelectBuilder
SubqueryInitiator
for the select item with the given alias.
When the builder finishes, the select item is added to the parent container represented by the type X
.selectSubquery
in interface SelectBuilder<T,X extends BaseQueryBuilder<T,X>>
alias
- The select alias for the subquerySubqueryInitiator<? extends BaseQueryBuilder<T,?>> selectSubquery(String subqueryAlias, String expression, String selectAlias)
SelectBuilder
SubqueryInitiator
for a new select item with the given select alias.
All occurrences of
subqueryAlias
in expression
will be replaced by the subquery.
When the builder finishes, the select item is added to the parent container represented by the type X
.
selectSubquery
in interface SelectBuilder<T,X extends BaseQueryBuilder<T,X>>
subqueryAlias
- The alias for the subquery which will be replaced by the actual subqueryexpression
- The expression which will be added as select item.
This expression contains the subqueryAlias
to define the insertion points for the subquery.selectAlias
- The select alias for the expressionSubqueryInitiator<? extends BaseQueryBuilder<T,?>> selectSubquery(String subqueryAlias, String expression)
SelectBuilder
SelectBuilder.selectSubquery(java.lang.String,java.lang.String,java.lang.String)
but without a select alias.selectSubquery
in interface SelectBuilder<T,X extends BaseQueryBuilder<T,X>>
subqueryAlias
- The alias for the subquery which will be replaced by the actual subqueryexpression
- The expression which will be added as select itemCopyright © 2015 Blazebit. All Rights Reserved.