For such cases you should do some work. There are different approaches to do that. See Spring docs and examples about JPA.
E.g. you can use @Query or specifications.
For such cases you should do some work. There are different approaches to do that. See Spring docs and examples about JPA.
E.g. you can use @Query or specifications.
You can try "Query creation from method names".
Let's say you want to search Orders by orderstatus <> submitted,
List<Order> findByOrderstatusNot(String orderstatus);
Have you taken a look at the documentation about this in the Spring Data JPA docs?
#findByStatusCodeNot(String statusCode);
It's akin the example in the docs like:
#findByLastnameNot
According to the Spring Data JPA Documentation on https://docs.spring.io/spring-data/jpa/docs/current/reference/html/#reference
you can achieve this by using the Not keyword. For instance your method would become
findByStatusCodeNot(String statusCode);
This means to achieve statusCode != 'Denied', you would call the method as
findByStatusCodeNot('Denied');