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>
public interface SubqueryInitiator<T> extends FromBaseBuilder<SubqueryBuilder<T>>
An interface used to create subquery builders.
- Since:
- 1.0.0
- Author:
- Christian Beikov
-
Method Summary
Modifier and Type Method Description SubqueryBuilder<T>from(Class<?> entityClass)Likefrom(java.lang.Class, java.lang.String)with the alias equivalent to the camel cased result of whatClass.getSimpleName()of the entity class returns.SubqueryBuilder<T>from(Class<?> entityClass, String alias)Creates a new subquery builder with the given entity class as entity in the FROM clause with the given alias.SubqueryBuilder<T>from(String correlationPath)Likefrom(String, String)with the alias equivalent to the camel cased result of the class of the correlation parent.SubqueryBuilder<T>from(String correlationPath, String alias)Creates a new subquery builder with the given correlation path in the FROM clause with the given alias.SubqueryBuilder<T>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.SubqueryBuilder<T>from(javax.persistence.metamodel.EntityType<?> entityType, String alias)Creates a new subquery builder with the entity class on which the query should be based on with the given alias.SubqueryBuilder<T>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).SubqueryBuilder<T>fromNew(Class<?> entityClass)Likefrom(Class)but explicitly queries the data after any side effects happen because of CTEs.SubqueryBuilder<T>fromNew(Class<?> entityClass, String alias)Likefrom(Class, String)but explicitly queries the data after any side effects happen because of CTEs.SubqueryBuilder<T>fromOld(Class<?> entityClass)Likefrom(Class)but explicitly queries the data before any side effects happen because of CTEs.SubqueryBuilder<T>fromOld(Class<?> entityClass, String alias)Likefrom(Class, String)but explicitly queries the data before any side effects happen because of CTEs.SubqueryBuilder<T>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.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.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).<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).CommonQueryBuilder<?>getParentQueryBuilder()Returns the parent query builder.StartOngoingSetOperationSubqueryBuilder<T,LeafOngoingFinalSetOperationSubqueryBuilder<T>>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:
fromin 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:
fromin 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:
fromin 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:
fromin 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:
fromOldin 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:
fromOldin 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:
fromNewin 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:
fromNewin 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:
fromValuesin 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:
fromValuesin 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:
fromIdentifiableValuesin 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:
fromValuesin 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:
fromValuesin 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:
fromIdentifiableValuesin 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
-