How to use Distinct and Order By together in JPA Query Methods
I am using a projection interface to get data for a specific case. I cannot share the real code so I am sharing a similar example here. I have a Employee entity class and created a projection interface EmployeeProjection as shown below.
How to use Distinct and Order By together in JPA Query Methods
I am using a projection interface to get data for a specific case. I cannot share the real code so I am sharing a similar example here. I have a Employee entity class and created a projection interface EmployeeProjection as shown below.
Commit in JPA transaction inside the method
My use case:
Collect records with time difference between a database column and current time on MSSQL database using Spring Boot Specification
I need to get the records with time diff of 60 minutes between a column in the database and the current time. I am using the below specification for the same on MSSQL database using Spring Boot.
Would the code in lambda run within the same transaction?
BizService class, marked as transactional
I want to save data from the same form to two different tables without declaring the second model in my save method
UserController.java:
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.
JPA repository object autowired cannot find the method signature passed with String in findOne
I am following a course on Spring Boot and creating a simple application that implements RestAPI. The application makes use of JPA, H2 Database and Spring Web. All libs are resolved, using Maven for building the application.
JPA repository object autowired cannot find the method findOne passed with String
I am following a course on Spring Boot and creating a simple application that implements RestAPI. The application makes use of JPA, H2 Database and Spring Web. All libs are resolved, using Maven for building the application.
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