Package com.blazebit.persistence
Interface SubqueryInitiator<T>
- Type Parameters:
T
- The builder type that is returned on terminal operations
- All Superinterfaces:
FromBaseBuilder<SubqueryBuilder<T>>
- All Known Subinterfaces:
QuantifiableBinaryPredicateBuilder<T>
An interface used to create subquery builders.
- Since:
- 1.0.0
- Author:
- Christian Beikov
-
Method Summary
Modifier and TypeMethodDescriptionLikefrom(java.lang.Class, java.lang.String)
with the alias equivalent to the camel cased result of whatClass.getSimpleName()
of the entity class returns.Creates a new subquery builder with the given entity class as entity in the FROM clause with the given alias.Likefrom(String, String)
with the alias equivalent to the camel cased result of the class of the correlation parent.Creates a new subquery builder with the given correlation path in the FROM clause with the given alias.from
(javax.persistence.metamodel.EntityType<?> entityType) Likefrom(EntityType, String)
with the alias equivalent to the camel cased result of whatEntityType.getName()
of the entity class returns.Creates a new subquery builder with the entity class on which the query should be based on with the given alias.fromIdentifiableValues
(Class<?> valueClass, String alias, int valueCount) Creates a new subquery builder with a VALUES clause for values of the given value class in the from clause.<X> SubqueryBuilder<T>
fromIdentifiableValues
(Class<X> valueClass, String alias, Collection<X> values) LikefromIdentifiableValues(Class, String, int)
but passes the collection size as valueCount and directly binds the collection as parameter viaParameterHolder.setParameter(String, Object)
.Likefrom(Class)
but explicitly queries the data after any side effects happen because of CTEs.Likefrom(Class, String)
but explicitly queries the data after any side effects happen because of CTEs.Likefrom(Class)
but explicitly queries the data before any side effects happen because of CTEs.Likefrom(Class, String)
but explicitly queries the data before any side effects happen because of CTEs.fromValues
(Class<?> valueClass, String alias, int valueCount) Creates a new subquery builder with a VALUES clause for values of the given value class in the from clause.fromValues
(Class<?> entityBaseClass, String attributeName, String alias, int valueCount) Creates a new subquery builder with a VALUES clause for values of the type as determined by the given entity attribute to the from clause.fromValues
(Class<?> entityBaseClass, String attributeName, String alias, Collection<?> values) LikefromValues(Class, String, String, int)
but passes the collection size as valueCount and directly binds the collection as parameter viaParameterHolder.setParameter(String, Object)
.<X> SubqueryBuilder<T>
fromValues
(Class<X> valueClass, String alias, Collection<X> values) LikefromValues(Class, String, int)
but passes the collection size as valueCount and directly binds the collection as parameter viaParameterHolder.setParameter(String, Object)
.Returns the parent query builder.startSet()
Starts a nested set operation builder which is used as subquery.Methods inherited from interface com.blazebit.persistence.FromBaseBuilder
fromEntitySubquery, fromEntitySubquery, fromEntitySubquery, fromIdentifiableValues, fromIdentifiableValues, fromSubquery, fromSubquery
-
Method Details
-
getParentQueryBuilder
CommonQueryBuilder<?> getParentQueryBuilder()Returns the parent query builder.- Returns:
- The parent query builder
- Since:
- 1.3.0
-
from
Likefrom(String, String)
with the alias equivalent to the camel cased result of the class of the correlation parent.- Parameters:
correlationPath
- The correlation path which should be queried- Returns:
- A new subquery builder
- Since:
- 1.2.0
-
from
Creates a new subquery builder with the given correlation path in the FROM clause with the given alias.- Parameters:
correlationPath
- The correlation path which should be queriedalias
- The alias for the entity- Returns:
- A new subquery builder
- Since:
- 1.2.0
-
startSet
StartOngoingSetOperationSubqueryBuilder<T,LeafOngoingFinalSetOperationSubqueryBuilder<T>> startSet()Starts a nested set operation builder which is used as subquery. Doing this is like starting a nested query that will be connected via a set operation.- Returns:
- A new set operation builder for the subquery
- Since:
- 1.2.0
-
from
Likefrom(java.lang.Class, java.lang.String)
with the alias equivalent to the camel cased result of whatClass.getSimpleName()
of the entity class returns.- Specified by:
from
in interfaceFromBaseBuilder<T>
- Parameters:
entityClass
- The entity class which should be the entity- Returns:
- A new subquery builder
-
from
Creates a new subquery builder with the given entity class as entity in the FROM clause with the given alias.- Specified by:
from
in interfaceFromBaseBuilder<T>
- Parameters:
entityClass
- The entity class which should be the entityalias
- The alias for the entity- Returns:
- A new subquery builder
-
from
Likefrom(EntityType, String)
with the alias equivalent to the camel cased result of whatEntityType.getName()
of the entity class returns.- Specified by:
from
in interfaceFromBaseBuilder<T>
- Parameters:
entityType
- The entity type which should be queried- Returns:
- A new subquery builder
- Since:
- 1.3.0
-
from
Creates a new subquery builder with the entity class on which the query should be based on with the given alias.- Specified by:
from
in interfaceFromBaseBuilder<T>
- Parameters:
entityType
- The entity type which should be queriedalias
- The alias for the entity- Returns:
- A new subquery builder
- Since:
- 1.3.0
-
fromOld
Likefrom(Class)
but explicitly queries the data before any side effects happen because of CTEs.- Specified by:
fromOld
in interfaceFromBaseBuilder<T>
- Parameters:
entityClass
- The entity class which should be queried- Returns:
- A new subquery builder
- Since:
- 1.2.0
-
fromOld
Likefrom(Class, String)
but explicitly queries the data before any side effects happen because of CTEs.- Specified by:
fromOld
in interfaceFromBaseBuilder<T>
- Parameters:
entityClass
- The entity class which should be queriedalias
- The alias for the entity- Returns:
- A new subquery builder
- Since:
- 1.2.0
-
fromNew
Likefrom(Class)
but explicitly queries the data after any side effects happen because of CTEs.- Specified by:
fromNew
in interfaceFromBaseBuilder<T>
- Parameters:
entityClass
- The entity class which should be queried- Returns:
- A new subquery builder
- Since:
- 1.2.0
-
fromNew
Likefrom(Class, String)
but explicitly queries the data after any side effects happen because of CTEs.- Specified by:
fromNew
in interfaceFromBaseBuilder<T>
- Parameters:
entityClass
- The entity class which should be queriedalias
- The alias for the entity- Returns:
- A new subquery builder
- Since:
- 1.2.0
-
fromValues
Creates a new subquery builder with a VALUES clause for values of the given value class in the from clause. This introduces a parameter named like the given alias. To set the values invokeParameterHolder.setParameter(String, Object)
orQuery.setParameter(String, Object)
with the alias and a collection.- Specified by:
fromValues
in interfaceFromBaseBuilder<T>
- Parameters:
valueClass
- The class of the basic or managed type for which to create a VALUES clausealias
- The alias for the entityvalueCount
- The number of values to use for the values clause- Returns:
- A new subquery builder
- Since:
- 1.2.0
-
fromValues
SubqueryBuilder<T> fromValues(Class<?> entityBaseClass, String attributeName, String alias, int valueCount) Creates a new subquery builder with a VALUES clause for values of the type as determined by the given entity attribute to the from clause. This introduces a parameter named like the given alias. To set the values invokeParameterHolder.setParameter(String, Object)
orQuery.setParameter(String, Object)
with the alias and a collection.- Specified by:
fromValues
in interfaceFromBaseBuilder<T>
- Parameters:
entityBaseClass
- The entity class on which the attribute is locatedattributeName
- The attribute name within the entity class which to use for determining the values typealias
- The alias for the entityvalueCount
- The number of values to use for the values clause- Returns:
- The new subquery builder
- Since:
- 1.3.0
-
fromIdentifiableValues
Creates a new subquery builder with a VALUES clause for values of the given value class in the from clause. This introduces a parameter named like the given alias. In contrast tofromValues(Class, String, int)
this will only bind the id attribute. To set the values invokeParameterHolder.setParameter(String, Object)
orQuery.setParameter(String, Object)
with the alias and a collection.- Specified by:
fromIdentifiableValues
in interfaceFromBaseBuilder<T>
- Parameters:
valueClass
- The class of the identifiable type for which to create a VALUES clausealias
- The alias for the entityvalueCount
- The number of values to use for the values clause- Returns:
- A new subquery builder
- Since:
- 1.2.0
-
fromValues
LikefromValues(Class, String, int)
but passes the collection size as valueCount and directly binds the collection as parameter viaParameterHolder.setParameter(String, Object)
.- Specified by:
fromValues
in interfaceFromBaseBuilder<T>
- Type Parameters:
X
- The type of the values- Parameters:
valueClass
- The class of the basic or managed type for which to create a VALUES clausealias
- The alias for the entityvalues
- The values to use for the values clause- Returns:
- A new subquery builder
- Since:
- 1.2.0
-
fromValues
SubqueryBuilder<T> fromValues(Class<?> entityBaseClass, String attributeName, String alias, Collection<?> values) LikefromValues(Class, String, String, int)
but passes the collection size as valueCount and directly binds the collection as parameter viaParameterHolder.setParameter(String, Object)
.- Specified by:
fromValues
in interfaceFromBaseBuilder<T>
- Parameters:
entityBaseClass
- The entity class on which the attribute is locatedattributeName
- The attribute name within the entity class which to use for determining the values typealias
- The alias for the entityvalues
- The values to use for the values clause- Returns:
- The new subquery builder
- Since:
- 1.3.0
-
fromIdentifiableValues
<X> SubqueryBuilder<T> fromIdentifiableValues(Class<X> valueClass, String alias, Collection<X> values) LikefromIdentifiableValues(Class, String, int)
but passes the collection size as valueCount and directly binds the collection as parameter viaParameterHolder.setParameter(String, Object)
.- Specified by:
fromIdentifiableValues
in interfaceFromBaseBuilder<T>
- Type Parameters:
X
- The type of the values- Parameters:
valueClass
- The class of the identifiable type for which to create a VALUES clausealias
- The alias for the entityvalues
- The values to use for the values clause- Returns:
- A new subquery builder
- Since:
- 1.2.0
-