AnsweredAssumed Answered

query api supporting multiple or conditions

Question asked by k5 on Jan 5, 2015

i needed an api to express more complex queries than the current api would allow(e.g. selecting all tasks of a list of process instances, or were two processvariables are same/different). So i diddled around with the native queries and an ibatis mapper. The final approach was to generate native queries based on the custom sql like syntax, bound to an interface.

   public interface ListByProcessDefinition extends Variables {

      @Query("processDefinitionKey = :key")
      List<ProcessInstance> listByProcessDefinitionKey(@Param("key") String key);

      @Query("(processDefinitionKey = :key1 AND var.stringVar='1') OR (processDefinitionKey = :key2 AND var.stringVar='2')")
      List<ProcessInstance> listByProcessDefinitionOr(@Param("key1") String key1, @Param("key2") String key2);

(Variables is a marker interface providing type information for the processvaribles)

The full testcase can be found here.
The whole project is at

So my questions are:
- Whats the general opinion about that approach?
- What are the future plans for the current fluent api? Will it go beyond the single "or" condition?
- What further queries/syntax could be interesting? (e.g. "isDue" over "dueDate >= now()" , how to include paging/sorting optional including of variables)