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>
,BaseInsertCriteriaBuilder<T,X>
,BaseQueryBuilder<T,X>
,BaseSubqueryBuilder<X>
,CorrelationQueryBuilder<X>
,CriteriaBuilder<T>
,FromBuilder<X>
,FullQueryBuilder<T,X>
,FullSelectCTECriteriaBuilder<X>
,InsertCriteriaBuilder<T>
,LeafOngoingSetOperationCriteriaBuilder<X>
,LeafOngoingSetOperationCTECriteriaBuilder<X>
,LeafOngoingSetOperationSubqueryBuilder<X>
,OngoingSetOperationCriteriaBuilder<T,Y>
,OngoingSetOperationCTECriteriaBuilder<T,Y>
,OngoingSetOperationSubqueryBuilder<T,Y>
,PaginatedCriteriaBuilder<T>
,QuantifiableBinaryPredicateBuilder<T>
,QueryBuilder<T,X>
,ReturningInsertCriteriaBuilder<T,X>
,SelectBaseCTECriteriaBuilder<X>
,SelectCTECriteriaBuilder<X>
,SelectRecursiveCTECriteriaBuilder<X>
,StartOngoingSetOperationCriteriaBuilder<X,Y>
,StartOngoingSetOperationCTECriteriaBuilder<X,Y>
,StartOngoingSetOperationSubqueryBuilder<X,Y>
,SubqueryBuilder<T>
,SubqueryInitiator<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
All Methods Instance Methods Abstract Methods Modifier and Type Method Description X
from(Class<?> entityClass)
Likefrom(Class, String)
with the alias equivalent to the camel cased result of whatClass.getSimpleName()
of the entity class returns.X
from(Class<?> entityClass, String alias)
Sets the entity class on which the query should be based on with the given alias.X
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.X
from(javax.persistence.metamodel.EntityType<?> entityType, String alias)
Sets the entity class on which the query should be based on with the given alias.FullSelectCTECriteriaBuilder<X>
fromEntitySubquery(Class<?> entityClass)
LikefromEntitySubquery(Class, String)
with the alias equivalent to the camel cased result of whatClass.getSimpleName()
of the entity class returns.FullSelectCTECriteriaBuilder<X>
fromEntitySubquery(Class<?> entityClass, String alias)
FullSelectCTECriteriaBuilder<X>
fromEntitySubquery(Class<?> entityClass, String alias, String subqueryAlias)
X
fromIdentifiableValues(Class<?> valueClass, String alias, int valueCount)
Add a VALUES clause for values of the given value class to the from clause.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.<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)
.X
fromNew(Class<?> entityClass)
Likefrom(Class)
but explicitly queries the data after any side effects happen because of CTEs.X
fromNew(Class<?> entityClass, String alias)
Likefrom(Class, String)
but explicitly queries the data after any side effects happen because of CTEs.X
fromOld(Class<?> entityClass)
Likefrom(Class)
but explicitly queries the data before any side effects happen because of CTEs.X
fromOld(Class<?> entityClass, String alias)
Likefrom(Class, String)
but explicitly queries the data before any side effects happen because of CTEs.FullSelectCTECriteriaBuilder<X>
fromSubquery(Class<?> cteClass)
LikefromSubquery(Class, String)
with the alias equivalent to the camel cased result of whatClass.getSimpleName()
of the entity class returns.FullSelectCTECriteriaBuilder<X>
fromSubquery(Class<?> cteClass, String alias)
X
fromValues(Class<?> valueClass, String alias, int valueCount)
Add a VALUES clause for values of the given value class to the from clause.X
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.X
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 Detail
-
from
X from(Class<?> entityClass)
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
X from(Class<?> entityClass, String alias)
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
X 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.- Parameters:
entityType
- The entity type which should be queried- Returns:
- The query builder for chaining calls
- Since:
- 1.3.0
-
from
X from(javax.persistence.metamodel.EntityType<?> entityType, String alias)
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
X fromOld(Class<?> entityClass)
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
X fromOld(Class<?> entityClass, String alias)
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
X fromNew(Class<?> entityClass)
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
X fromNew(Class<?> entityClass, String alias)
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
X fromValues(Class<?> valueClass, 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. 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
X 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. 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
X fromIdentifiableValues(Class<?> valueClass, 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 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
<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)
.- 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
X 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)
.- 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
<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)
.- 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
FullSelectCTECriteriaBuilder<X> fromSubquery(Class<?> cteClass)
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
FullSelectCTECriteriaBuilder<X> fromSubquery(Class<?> cteClass, String alias)
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
FullSelectCTECriteriaBuilder<X> fromEntitySubquery(Class<?> entityClass)
LikefromEntitySubquery(Class, String)
with the alias equivalent to the camel cased result of whatClass.getSimpleName()
of the entity class returns.- 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
FullSelectCTECriteriaBuilder<X> 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.- 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
FullSelectCTECriteriaBuilder<X> 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.- 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
-
-