Interface QueryBuilderFactory

All Known Implementing Classes:
QueryBuilderFactoryImpl

@Deprecated public interface QueryBuilderFactory
Deprecated.
  • Method Details

    • find

      QueryBuilder find(String entityName)
      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

      QueryBuilder resolve(Entity source, String relationPath)
      Deprecated.
      Creates a QueryBuilder 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 returned QueryBuilder can be used to further constrain the query or add ordering information.
    • resolve

      QueryBuilder resolve(EntityId source, Path relationPath)
      Deprecated.
      Same as resolve(Entity, Path) using the model and primary key from the given entity id.
    • resolve

      QueryBuilder resolve(EntityId source, String relationPath)
      Deprecated.
      Same as resolve(Entity, Path) using the model and primary key from the given entity id.
    • resolve

      QueryBuilder resolve(Entity source, Path relationPath)
      Deprecated.
      Creates a QueryBuilder 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 returned QueryBuilder can be used to further constrain the query or add ordering information.
    • compileCondition

      @Deprecated Condition compileCondition(String query) throws PersistException
      Deprecated.

      Compiles 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

      Condition compileCondition(String entityName, String condition)
      Deprecated.
      Compiles the given query condition string and creates a Condition to be used to apply to a QueryBuilder.
      Parameters:
      entityName - the base entity name
      condition - a query condition `firstname == "test"`
      Returns:
      the compiled condition.
    • compileOrder

      Iterable<Order> compileOrder(String query)
      Deprecated.

      Compiles the given query string and creates a list of Order objects to be used with a QueryBuilder. A full query must be supplied, otherwise an exception is thrown (e.g. if the order by clause is missing!).

      Parameters:
      query - a full query with a order-by clause, like `find User order by firstname, lastname asc`
    • evaluate

      boolean evaluate(Condition condition, Entity target, Map<String,Object> params)
      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

      boolean evaluate(Condition condition, Entity target)
      Deprecated.
      Same as evaluate(Condition, Entity, Map) forwarding an empty parameter map for convenience.
    • asPredicate

      Predicate<Entity> asPredicate(Condition condition)
      Deprecated.
      Get a Predicate for the provided Condition. It can be used, for example to filter a list of previously loaded Entitys.
      Parameters:
      condition - a Condition