Class QueryBuilderFactoryImpl
java.lang.Object
ch.tocco.nice2.persist.core.impl.qb2.QueryBuilderFactoryImpl
- All Implemented Interfaces:
QueryBuilderFactory
@Component("legacyQueryBuilderFactoryImpl")
@Deprecated
public class QueryBuilderFactoryImpl
extends Object
implements QueryBuilderFactory
Deprecated.
-
Constructor Summary
ConstructorsConstructorDescriptionQueryBuilderFactoryImpl(TypeManager typeManager, DataModel dataModel, PersistenceService persistenceService, ConditionFactory conditionFactory, QueryCompiler compiler) Deprecated. -
Method Summary
Modifier and TypeMethodDescriptionasPredicate(Condition condition) compileCondition(String query) Deprecated.Compiles the given query string and creates a condition to be used to apply to a query builder.compileCondition(String entityName, String condition) Deprecated.Compiles the given query condition string and creates aConditionto be used to apply to aQueryBuilder.compileOrder(String query) Deprecated.Compiles the given query string and creates a list ofOrderobjects to be used with aQueryBuilder.booleanDeprecated.Same asQueryBuilderFactory.evaluate(Condition, Entity, Map)forwarding an empty parameter map for convenience.booleanDeprecated.Evaluates the given `condition` against the given entity.Deprecated.Creates a new and emptyQueryBuilderobject to build a query for the given entity model.Deprecated.Same asQueryBuilderFactory.resolve(Entity, Path)using the model and primary key from the given entity id.Deprecated.Same asQueryBuilderFactory.resolve(Entity, Path)using the model and primary key from the given entity id.Deprecated.Creates aQueryBuilderinitialized to a query that is deduced from resolving the given relation path against the given source entity.Deprecated.Creates aQueryBuilderinitialized to a query that is deduced from resolving the given relation path against the given source entity.
-
Constructor Details
-
QueryBuilderFactoryImpl
public QueryBuilderFactoryImpl(TypeManager typeManager, @Lazy DataModel dataModel, @Lazy PersistenceService persistenceService, ConditionFactory conditionFactory, @Lazy QueryCompiler compiler) Deprecated.
-
-
Method Details
-
find
Deprecated.Description copied from interface:QueryBuilderFactoryCreates a new and empty
QueryBuilderobject 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.
- Specified by:
findin interfaceQueryBuilderFactory
-
resolve
Deprecated.Description copied from interface:QueryBuilderFactoryCreates aQueryBuilderinitialized 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 returnedQueryBuildercan be used to further constrain the query or add ordering information.- Specified by:
resolvein interfaceQueryBuilderFactory
-
resolve
Deprecated.Description copied from interface:QueryBuilderFactoryCreates aQueryBuilderinitialized 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 returnedQueryBuildercan be used to further constrain the query or add ordering information.- Specified by:
resolvein interfaceQueryBuilderFactory
-
resolve
Deprecated.Description copied from interface:QueryBuilderFactorySame asQueryBuilderFactory.resolve(Entity, Path)using the model and primary key from the given entity id.- Specified by:
resolvein interfaceQueryBuilderFactory
-
resolve
Deprecated.Description copied from interface:QueryBuilderFactorySame asQueryBuilderFactory.resolve(Entity, Path)using the model and primary key from the given entity id.- Specified by:
resolvein interfaceQueryBuilderFactory
-
compileCondition
Deprecated.Description copied from interface:QueryBuilderFactoryCompiles 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
whereclause is missing).Note, that an
order byclause is ignored, obviously.- Specified by:
compileConditionin interfaceQueryBuilderFactory- 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.Description copied from interface:QueryBuilderFactoryCompiles the given query condition string and creates aConditionto be used to apply to aQueryBuilder.- Specified by:
compileConditionin interfaceQueryBuilderFactory- Parameters:
entityName- the base entity namecondition- a query condition`firstname == "test"`- Returns:
- the compiled condition.
-
compileOrder
Deprecated.Description copied from interface:QueryBuilderFactoryCompiles the given query string and creates a list of
Orderobjects to be used with aQueryBuilder. A full query must be supplied, otherwise an exception is thrown (e.g. if theorder byclause is missing!).- Specified by:
compileOrderin interfaceQueryBuilderFactory- Parameters:
query- a full query with a order-by clause, like`find User order by firstname, lastname asc`- Throws:
PersistException
-
evaluate
Deprecated.Description copied from interface:QueryBuilderFactoryEvaluates 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.- Specified by:
evaluatein interfaceQueryBuilderFactory
-
evaluate
Deprecated.Description copied from interface:QueryBuilderFactorySame asQueryBuilderFactory.evaluate(Condition, Entity, Map)forwarding an empty parameter map for convenience.- Specified by:
evaluatein interfaceQueryBuilderFactory
-
asPredicate
Deprecated.Description copied from interface:QueryBuilderFactoryGet aPredicatefor the providedCondition. It can be used, for example to filter a list of previously loadedEntitys.- Specified by:
asPredicatein interfaceQueryBuilderFactory- Parameters:
condition- aCondition
-