Interface QueryBuilderFactory
- All Known Implementing Classes:
QueryBuilderFactoryImpl
Deprecated.
-
Method Summary
Modifier and TypeMethodDescriptionasPredicate
(Condition condition) compileCondition
(String query) Deprecated.usecompileCondition(String, String)
insteadcompileCondition
(String entityName, String condition) Deprecated.Compiles the given query condition string and creates aCondition
to be used to apply to aQueryBuilder
.compileOrder
(String query) Deprecated.Compiles the given query string and creates a list ofOrder
objects to be used with aQueryBuilder
.boolean
Deprecated.Same asevaluate(Condition, Entity, Map)
forwarding an empty parameter map for convenience.boolean
Deprecated.Evaluates the given `condition` against the given entity.Deprecated.Creates a new and emptyQueryBuilder
object to build a query for the given entity model.Deprecated.Same asresolve(Entity, Path)
using the model and primary key from the given entity id.Deprecated.Same asresolve(Entity, Path)
using the model and primary key from the given entity id.Deprecated.Creates aQueryBuilder
initialized to a query that is deduced from resolving the given relation path against the given source entity.Deprecated.Creates aQueryBuilder
initialized to a query that is deduced from resolving the given relation path against the given source entity.
-
Method Details
-
find
Deprecated.Creates a new and empty
QueryBuilder
object to build a query for the given entity model. The returned object is stateful and cannot be used concurrently by different threads.Conditions are combined by
Junction.Type.AND
.Note, that the returned builder is stateful and is not thread-safe.
-
resolve
Deprecated.Creates aQueryBuilder
initialized to a query that is deduced from resolving the given relation path against the given source entity. For example, for a `User` entity and the path `relAddress.relAddress_status`, the query builder will be created with the query `find Address_status where relAddress.relUser.pk=?`. The returnedQueryBuilder
can be used to further constrain the query or add ordering information. -
resolve
Deprecated.Same asresolve(Entity, Path)
using the model and primary key from the given entity id. -
resolve
Deprecated.Same asresolve(Entity, Path)
using the model and primary key from the given entity id. -
resolve
Deprecated.Creates aQueryBuilder
initialized to a query that is deduced from resolving the given relation path against the given source entity. For example, for a `User` entity and the path `relAddress.relAddress_status`, the query builder will be created with the query `find Address_status where relAddress.relUser.pk=?`. The returnedQueryBuilder
can be used to further constrain the query or add ordering information. -
compileCondition
Deprecated.usecompileCondition(String, String)
insteadCompiles the given query string and creates a condition to be used to apply to a query builder. A full query must be supplied, otherwise an exception is thrown (e.g. if the
where
clause is missing).Note, that an
order by
clause is ignored, obviously.- Parameters:
query
- a full query with a where clause, like`find User where firstname == "test"`
- Returns:
- a condition compiled from the where clause of the query
- Throws:
PersistException
-
compileCondition
Deprecated.Compiles the given query condition string and creates aCondition
to be used to apply to aQueryBuilder
.- Parameters:
entityName
- the base entity namecondition
- a query condition`firstname == "test"`
- Returns:
- the compiled condition.
-
compileOrder
Deprecated.Compiles the given query string and creates a list of
Order
objects to be used with aQueryBuilder
. A full query must be supplied, otherwise an exception is thrown (e.g. if theorder by
clause is missing!).- Parameters:
query
- a full query with a order-by clause, like`find User order by firstname, lastname asc`
-
evaluate
Deprecated.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
Deprecated.Same asevaluate(Condition, Entity, Map)
forwarding an empty parameter map for convenience. -
asPredicate
Deprecated.Get aPredicate
for the providedCondition
. It can be used, for example to filter a list of previously loadedEntity
s.- Parameters:
condition
- aCondition
-
QueryBuilderFactory