Package com.blazebit.persistence
Interface FromBaseBuilder<X extends FromBaseBuilder<X>>
- Type Parameters:
X
- The concrete builder type
- All Known Subinterfaces:
BaseCriteriaBuilder<T,
,X> BaseCTECriteriaBuilder<X>
,BaseDeleteCriteriaBuilder<T,
,X> BaseFromQueryBuilder<T,
,X> BaseInsertCriteriaBuilder<T,
,X> BaseModificationCriteriaBuilder<X>
,BaseQueryBuilder<T,
,X> BaseSubqueryBuilder<X>
,BaseUpdateCriteriaBuilder<T,
,X> CorrelationQueryBuilder<X>
,CriteriaBuilder<T>
,DeleteCriteriaBuilder<T>
,FromBuilder<X>
,FullQueryBuilder<T,
,X> FullSelectCTECriteriaBuilder<X>
,InsertCriteriaBuilder<T>
,LeafOngoingSetOperationCriteriaBuilder<X>
,LeafOngoingSetOperationCTECriteriaBuilder<X>
,LeafOngoingSetOperationSubqueryBuilder<X>
,ModificationCriteriaBuilder<X>
,OngoingSetOperationCriteriaBuilder<T,
,Y> OngoingSetOperationCTECriteriaBuilder<T,
,Y> OngoingSetOperationSubqueryBuilder<T,
,Y> PaginatedCriteriaBuilder<T>
,QuantifiableBinaryPredicateBuilder<T>
,QueryBuilder<T,
,X> ReturningDeleteCriteriaBuilder<T,
,X> ReturningInsertCriteriaBuilder<T,
,X> ReturningModificationCriteriaBuilder<X,
,Y> ReturningUpdateCriteriaBuilder<T,
,X> SelectBaseCTECriteriaBuilder<X>
,SelectCTECriteriaBuilder<X>
,SelectRecursiveCTECriteriaBuilder<X>
,StartOngoingSetOperationCriteriaBuilder<X,
,Y> StartOngoingSetOperationCTECriteriaBuilder<X,
,Y> StartOngoingSetOperationSubqueryBuilder<X,
,Y> SubqueryBuilder<T>
,SubqueryInitiator<T>
,UpdateCriteriaBuilder<T>
public interface FromBaseBuilder<X extends FromBaseBuilder<X>>
An interface for builders that support just the from clause.
- Since:
- 1.3.0
- Author:
- Christian Beikov
-
Method Summary
Modifier and TypeMethodDescriptionLikefrom(Class, String)
with the alias equivalent to the camel cased result of whatClass.getSimpleName()
of the entity class returns.Sets the entity class on which the query should be based on 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.Sets the entity class on which the query should be based on with the given alias.<Z extends BaseFromQueryBuilder<X,
? extends Z>>
ZfromEntitySubquery
(Class<?> entityClass) LikefromEntitySubquery(Class, String)
with the alias equivalent to the camel cased result of whatClass.getSimpleName()
of the entity class returns.<Z extends BaseFromQueryBuilder<X,
? extends Z>>
ZfromEntitySubquery
(Class<?> entityClass, String alias) <Z extends BaseFromQueryBuilder<X,
? extends Z>>
ZfromEntitySubquery
(Class<?> entityClass, String alias, String subqueryAlias) fromIdentifiableValues
(Class<?> valueClass, String alias, int valueCount) Add a VALUES clause for values of the given value class to the from clause.fromIdentifiableValues
(Class<?> valueClass, String identifierAttribute, String alias, int valueCount) Add a VALUES clause for values of the given value class to the from clause.<T> X
fromIdentifiableValues
(Class<T> valueClass, String identifierAttribute, String alias, Collection<T> values) LikefromIdentifiableValues(Class, String, String, int)
but passes the collection size as valueCount and directly binds the collection as parameter viaParameterHolder.setParameter(String, Object)
.<T> X
fromIdentifiableValues
(Class<T> valueClass, String alias, Collection<T> 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.fromSubquery
(Class<?> cteClass) LikefromSubquery(Class, String)
with the alias equivalent to the camel cased result of whatClass.getSimpleName()
of the entity class returns.fromSubquery
(Class<?> cteClass, String alias) fromValues
(Class<?> valueClass, String alias, int valueCount) Add a VALUES clause for values of the given value class to the from clause.fromValues
(Class<?> entityBaseClass, String attributeName, String alias, int valueCount) Add 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)
.<T> X
fromValues
(Class<T> valueClass, String alias, Collection<T> values) LikefromValues(Class, String, int)
but passes the collection size as valueCount and directly binds the collection as parameter viaParameterHolder.setParameter(String, Object)
.
-
Method Details
-
from
Likefrom(Class, String)
with the alias equivalent to the camel cased result of whatClass.getSimpleName()
of the entity class returns.- Parameters:
entityClass
- The entity class which should be queried- Returns:
- The query builder for chaining calls
-
from
Sets the entity class on which the query should be based on with the given alias.- Parameters:
entityClass
- The entity class which should be queriedalias
- The alias for the entity- Returns:
- The query builder for chaining calls
-
from
Likefrom(EntityType, String)
with the alias equivalent to the camel cased result of whatEntityType.getName()
of the entity class returns.- Parameters:
entityType
- The entity type which should be queried- Returns:
- The query builder for chaining calls
- Since:
- 1.3.0
-
from
Sets the entity class on which the query should be based on with the given alias.- Parameters:
entityType
- The entity type which should be queriedalias
- The alias for the entity- Returns:
- The query builder for chaining calls
- Since:
- 1.3.0
-
fromOld
Likefrom(Class)
but explicitly queries the data before any side effects happen because of CTEs.- Parameters:
entityClass
- The entity class which should be queried- Returns:
- The query builder for chaining calls
- Since:
- 1.1.0
-
fromOld
Likefrom(Class, String)
but explicitly queries the data before any side effects happen because of CTEs.- Parameters:
entityClass
- The entity class which should be queriedalias
- The alias for the entity- Returns:
- The query builder for chaining calls
- Since:
- 1.1.0
-
fromNew
Likefrom(Class)
but explicitly queries the data after any side effects happen because of CTEs.- Parameters:
entityClass
- The entity class which should be queried- Returns:
- The query builder for chaining calls
- Since:
- 1.1.0
-
fromNew
Likefrom(Class, String)
but explicitly queries the data after any side effects happen because of CTEs.- Parameters:
entityClass
- The entity class which should be queriedalias
- The alias for the entity- Returns:
- The query builder for chaining calls
- Since:
- 1.1.0
-
fromValues
Add a VALUES clause for values of the given value class 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.- 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:
- The query builder for chaining calls
- Since:
- 1.2.0
-
fromValues
Add 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.- 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 query builder for chaining calls
- Since:
- 1.3.0
-
fromIdentifiableValues
Add a VALUES clause for values of the given value class to 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.- 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:
- The query builder for chaining calls
- Since:
- 1.2.0
-
fromIdentifiableValues
X fromIdentifiableValues(Class<?> valueClass, String identifierAttribute, String alias, int valueCount) Add a VALUES clause for values of the given value class to the from clause. This introduces a parameter named like the given alias. In contrast tofromValues(Class, String, int)
this will only bind the identifier attribute. To set the values invokeParameterHolder.setParameter(String, Object)
orQuery.setParameter(String, Object)
with the alias and a collection.- Parameters:
valueClass
- The class of the identifiable type for which to create a VALUES clauseidentifierAttribute
- The attribute of the entity type to consider as identifier attributealias
- The alias for the entityvalueCount
- The number of values to use for the values clause- Returns:
- The query builder for chaining calls
- Since:
- 1.4.0
-
fromValues
LikefromValues(Class, String, int)
but passes the collection size as valueCount and directly binds the collection as parameter viaParameterHolder.setParameter(String, Object)
.- Type Parameters:
T
- 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:
- The query builder for chaining calls
- Since:
- 1.2.0
-
fromValues
LikefromValues(Class, String, String, int)
but passes the collection size as valueCount and directly binds the collection as parameter viaParameterHolder.setParameter(String, Object)
.- 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 query builder for chaining calls
- Since:
- 1.3.0
-
fromIdentifiableValues
LikefromIdentifiableValues(Class, String, int)
but passes the collection size as valueCount and directly binds the collection as parameter viaParameterHolder.setParameter(String, Object)
.- Type Parameters:
T
- 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:
- The query builder for chaining calls
- Since:
- 1.2.0
-
fromIdentifiableValues
<T> X fromIdentifiableValues(Class<T> valueClass, String identifierAttribute, String alias, Collection<T> values) LikefromIdentifiableValues(Class, String, String, int)
but passes the collection size as valueCount and directly binds the collection as parameter viaParameterHolder.setParameter(String, Object)
.- Type Parameters:
T
- The type of the values- Parameters:
valueClass
- The class of the identifiable type for which to create a VALUES clauseidentifierAttribute
- The attribute of the entity type to consider as identifier attributealias
- The alias for the entityvalues
- The values to use for the values clause- Returns:
- The query builder for chaining calls
- Since:
- 1.4.0
-
fromSubquery
LikefromSubquery(Class, String)
with the alias equivalent to the camel cased result of whatClass.getSimpleName()
of the entity class returns.- Parameters:
cteClass
- The CTE entity type for the subquery in the FROM clause- Returns:
- The CTE builder for the subquery in the FROM clause
- Since:
- 1.4.1
-
fromSubquery
Like callingfrom(Class, String)
followed byCTEBuilder.with(Class, boolean)
withinline = true
. Registers the given CTE entity type as FROM clause node under the given alias and returns a CTE builder that will be inlined.- Parameters:
cteClass
- The CTE entity type for the subquery in the FROM clausealias
- The alias for the FROM clause item- Returns:
- The CTE builder for the subquery in the FROM clause
- Since:
- 1.4.1
-
fromEntitySubquery
LikefromEntitySubquery(Class, String)
with the alias equivalent to the camel cased result of whatClass.getSimpleName()
of the entity class returns.- Type Parameters:
Z
- The builder return type- Parameters:
entityClass
- The entity type for the subquery in the FROM clause- Returns:
- The CTE builder for the subquery in the FROM clause
- Since:
- 1.4.1
-
fromEntitySubquery
<Z extends BaseFromQueryBuilder<X,? extends Z>> Z fromEntitySubquery(Class<?> entityClass, String alias) Like callingfrom(Class, String)
followed byCTEBuilder.with(Class, boolean)
withinline = true
. Registers the given entity type as FROM clause node under the given alias and returns a CTE builder that will be inlined with all attributes bound.- Type Parameters:
Z
- The builder return type- Parameters:
entityClass
- The entity type for the subquery in the FROM clausealias
- The alias for the FROM clause item- Returns:
- The CTE builder for the subquery in the FROM clause
- Since:
- 1.4.1
-
fromEntitySubquery
<Z extends BaseFromQueryBuilder<X,? extends Z>> Z fromEntitySubquery(Class<?> entityClass, String alias, String subqueryAlias) Like callingfrom(Class, String)
followed byCTEBuilder.with(Class, boolean)
withinline = true
. Registers the given entity type as FROM clause node under the given alias and returns a CTE builder that will be inlined with all attributes bound.- Type Parameters:
Z
- The builder return type- Parameters:
entityClass
- The entity type for the subquery in the FROM clausealias
- The alias for the FROM clause itemsubqueryAlias
- The alias for the FROM clause item in the subquery- Returns:
- The CTE builder for the subquery in the FROM clause
- Since:
- 1.4.1
-