1

R2dbcEntityTemplate has a method called select that allows me to use org.springframework.data.relational.core.query.Query to build my query statement using a Fluent API. I'm looking for a way to use this Fluent API on spring-data-jdbc in a non reactive project. I din't find any method in JdbcTemplate that I can pass a Query or CriteriaDefinition as parameter.

This is an example using R2dbcEntityTemplate:

r2dbcTemplate.select(OrderItem.class)
    .matching(query(where("order_id").is(orderId)))
    .all();

Any thoughts on how to use this with JdbcTemplate?

Jens Schauder
  • 77,657
  • 34
  • 181
  • 348

1 Answers1

1

Spring Data JDBC doesn't have such an API.

You might want to look into Querydsl or jOOQ.

Jens Schauder
  • 77,657
  • 34
  • 181
  • 348