Answer the question
In order to leave comments, you need to log in
How to make a conditional query in a List in JPA?
Good afternoon, please tell me how to make a query to the database.
I get as input a List of parameters id operators .
Now I need to make a request through JPA, I need to select all the records that contain the received id.
now I have a custom request
@Query(value = "FROM Task WHERE (Tasksid = null) AND Operator = :OperatorIds")
Set<Task> qualityTaskWIthoutCOmparsionId(@Param("OperatorIds") List<Long> OperatorIds);
Answer the question
In order to leave comments, you need to log in
As mentioned above, you need to use the following code
@Query(value = "FROM Task WHERE (Tasksid = null) AND Operator IN (:OperatorIds)")
Set<Task> qualityTaskWIthoutCOmparsionId(@Param("OperatorIds") List<Long> OperatorIds);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question