Interface QueryBuilderFactory
- All Known Implementing Classes:
QueryBuilderFactoryImpl
public interface QueryBuilderFactory
Factory class for hibernate query builders
-
Method Summary
Modifier and TypeMethodDescriptionasPredicate(Condition condition) Create a newCountQueryBuilderwhich executes count queries.Create a newCountQueryBuilderwhich executes count queries.Create a newCountQueryBuilderwhich executes count queries.Create a newCountQueryBuilderwhich executes count queries.default booleanSame asevaluate(Condition, Entity, Map)forwarding an empty parameter map for convenience.booleanEvaluates the given `condition` against the given entity.Create anEntityQueryBuilderwith the provided entity model as rootresolve(EntityReference source, Path relationPath) resolve(EntityReference source, String relationPath) Create anEntityQueryBuilderthat first resolves the given relation path and uses the target entity model of the given relation path as query root.resolveKeys(EntityReference source, Path relationPath) resolveKeys(EntityReference source, String relationPath) Create anPrimaryKeyQueryBuilderthat first resolves the given relation path and uses the target entity model of the given relation path as query root.<E> SinglePathQueryBuilder<E> Create aSinglePathQueryBuilderwith the provided entity model as root and the single column as selection<T> PathQueryBuilder<T> Create aPathQueryBuilderwith the provided entity model as root and the provided columns as selectiondefault PathQueryBuilder<Map> overload ofselect(Class, String, String...)that uses a Map as return type
-
Method Details
-
find
Create anEntityQueryBuilderwith the provided entity model as root- Parameters:
entityModel- the target entity model- Returns:
- the created
EntityQueryBuilder
-
findKeys
-
select
Create aPathQueryBuilderwith the provided entity model as root and the provided columns as selection- Parameters:
returnType- the type the query returns, currently either Map or Object[]entityModel- the target entity modelcolumns- the columns to select- Returns:
- the created
PathQueryBuilder
-
select
overload ofselect(Class, String, String...)that uses a Map as return type -
select
Create aSinglePathQueryBuilderwith the provided entity model as root and the single column as selection- Type Parameters:
E- the return type, equal to the type of the selected column- Parameters:
type- the type of the selected columnentityModel- the target entity modelcolumn- the selected column- Returns:
- the created
SinglePathQueryBuilder
-
resolve
Create anEntityQueryBuilderthat first resolves the given relation path and uses the target entity model of the given relation path as query root.- Parameters:
source- the source entityrelationPath- the relation path, e.g. 'relAddress_user.relAddress'- Returns:
- the created
EntityQueryBuilder
-
resolve
-
resolveKeys
Create anPrimaryKeyQueryBuilderthat first resolves the given relation path and uses the target entity model of the given relation path as query root.- Parameters:
source- the source entityrelationPath- the relation path, e.g. 'relAddress_user.relAddress'- Returns:
- the created
PrimaryKeyQueryBuilder
-
resolveKeys
-
count
Create a newCountQueryBuilderwhich executes count queries.- Parameters:
entityClass- the root entity
-
count
Create a newCountQueryBuilderwhich executes count queries.- Parameters:
modelName- the model name of the root entity
-
count
Create a newCountQueryBuilderwhich executes count queries.- Parameters:
entityClass- the root entityhints- optional hints about the query (seeQueryHintsfor available hints)
-
count
Create a newCountQueryBuilderwhich executes count queries.- Parameters:
modelName- the model name of the root entityhints- optional hints about the query (seeQueryHintsfor available hints)
-
evaluate
Evaluates the given `condition` against the given entity. Returns `true` if the entity would have been returned from a query formed by `condition`, `false` otherwise. The `params` map must contain all parameter values if those are used within the `condition`. Note that subqueries (like `EXISTS` and `COUNT`) and functions (like `fulltext` or `DISTANCE`) are currently *not* supported. `JdbcFunction`s (like `DISTANCE`) can't work anyways as they are directly translated to database calls. -
evaluate
Same asevaluate(Condition, Entity, Map)forwarding an empty parameter map for convenience. -
asPredicate
Get aPredicatefor the providedCondition. It can be used, for example to filter a list of previously loadedEntitys.- Parameters:
condition- aCondition
-