Skip to content

Replace derived CriteriaQuery with String-based JPQL queries #3588

Closed
@mp911de

Description

@mp911de

We should explore how we could switch from Criteria Queries to JPQL queries as Hibernate has a much better efficiency running String-based queries:

CriteriaBuilder query
Benchmark                                   Mode  Cnt       Score      Error  Units
RepositoryFinderTests.derivedFinderMethod  thrpt    5  110633,482 ± 3980,501  ops/s

String-based query
Benchmark                                   Mode  Cnt       Score       Error  Units
RepositoryFinderTests.derivedFinderMethod  thrpt    5  344518,379 ± 24561,002  ops/s

We would need to build our own JpqlQueryBuilder that mimics CriteriaBuilder in terms of expressions, predicates and automated inclusion of joins.

Collection of related tickets:

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions