QueryDSL
QueryDSL provides a way to express queries independently of the particular persistence mechanism, abstracting out whether the ORM in use is JDO or JPA.
Apache Causeway’s integration with QueryDSL provides the following capabilities:
-
Intended to be subclassed (it is
abstract
), and parameterized by the entity and its corresponding "Q" query class, this class provides a set of finder methods for a specified entity.These finder methods take queries written as QueryDSL expressions. More discussion on writing queries can be found here.
Internally, this class delegates to QueryDslSupport.
-
QueryDslSupport and DetachedQueryFactory
Provides the mechanism to construct arbitrary queries against any entity.
The query expressions from QueryDslSupport are attached, meaning they can be submitted directly to the database. Those from DetachedQueryFactory are detached; they cannot be submitted directly. Instead, they are intended to be combined with the attached queries, e.g. in subqueries.
Although QueryDslSupport itself is abstract, both the JPA and JDO persistence mechanisms provide concrete implementations.
-
AutoCompleteGeneratedQueryService
Primarily used internally to provide support for autocomplete (using @Property and optionally @DomainObject). However, the service can also be called directly by the application if required.
More discussion on using the annotations can be found here.