Relative Content

Tag Archive for javaspring-bootspring-data-jpa

How to create a dynamic select with spring data?

I’m creating a springboot microservices, with java, and spring-data-jpa. The idea is to create the repository with a dynamic select passing the fields to select from RequestParam, in runtime. Therefore, we’ll receive the fields in a List (“field1′,’field2′,’field3′), and we’ll select thsese fields from the entity. Of course, these fields can be change in every call.

what can I do “my query takin 3 sec to execute”?

@Query(“from User u where u.email in :emailIds”) List<User> findByListOfEmail(List<String> emailIds); the above query I mentioned is taking 3 sec to complete, I don’t know how to fix. I am not able to find the cause. Please any one know why please fix the problem. java spring-boot spring-data-jpa