This module provides a couple of interfaces for database querying instead of standard R2DBC Criteria
API.
Working with all relational databases which have reactive driver (PostgreSQL, MySQL, Oracle, MS SQL, etc.).
The main idea is to give developer more control over the query like JOOQ or
Criteria API. ย
QueryStep
interface supports basic SQL predicates:
=, !=, >, <, >=, <=, like, not like, in, not in, is true, is false, is null, is not null
.
Query
interface provides intermediate operators like where, or, and
.
And finally QueryExecutor
interface allows to choose SQL operation: find, findAll, save, update, delete
.
All you need is to inject QueryExecutor
to your data access layer:
private final QueryExecutor executor;
And use it with Query
:
executor.findAll(Query.where().isNotNull("id"), Entity.class);
or without it:
executor.findAll(Entity.class);
executor.save(entity);