3

In my view I send async request to controller with Json Data as following:

{
   "filters":{
      "someField":"someValue",
      "someField":"someValue",
      "someField":null,
      "someField":null,
   }
}

But data can be different. And I have Order Entity that has same fields, so I can convert It from Json to POJO

After that using JPA I can do following:

Example<Order> orderExample = Example.of(orderFromJson);
orderRepository.findAll(orderExample);

But I use spring-data-jdbc which doesn't support it, What can replace it?

Jens Schauder
  • 77,657
  • 34
  • 181
  • 348
DozezQuest
  • 179
  • 7

1 Answers1

0

For cases like this where no direct support is offered, the correct approach is to get a JdbcTemplate or NamedParameterJdbcTemplate injected, and construct the required SQL from your filter information. You may make the method a custom repository method.

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