spring-data-jpa Questions

10

I am trying to incorporate Spring-Data-JPA into my project. One thing that confuses me is how do I achieve setMaxResults(n) by annotation ? for example, my code: public interface UserRepository ext...
Ate asked 16/2, 2012 at 15:32

23

I'm developing a spring boot application and I'm running into an issue here. I'm trying to inject a @Repository annotated interface and it doesn't seem to work at all. I'm getting this error org.sp...
Spoonerism asked 23/3, 2015 at 22:29

3

Solved

I am using Spring Data JPA with Hibernate and am having trouble with the updatable=false property on the @Column annotation. I have a base class for all of my @Entity objects with a UUID defined l...
Elope asked 15/12, 2014 at 16:38

7

I have a lil problem with spring boot + jpa. I have add the dependency to the POM.xml, i can run it normally from spring tool suite (run as spring boot application). But when i run from command lin...
Tardif asked 15/4, 2017 at 12:46

9

I am getting no-error when trying to Build, compile and Verify But when i am trying run using Maven to run this project start getting "Closing JPA EntityManagerFactory for persistence unit 'de...
Jarl asked 18/10, 2021 at 16:20

2

I am trying to implement Pagination and sorting by using Pageable in Springboot, JPARepository. Somehow sorting is not working. I am including my code below where I have controller, service class, ...
Plumbo asked 7/12, 2018 at 6:26

1

Solved

In our Spring Boot 3 (Kotlin) project, we apply domain-driven design and want to avoid primitive obsession in entities and repositories (especially IDs, which often are of type GUID and can easily ...

4

Solved

I have a Spring App that uses JPA repositories (CrudRepository interfaces). When I try to test my controller using the new Spring test syntax @WebMvcTest(MyController.class), it fails coz it tries ...
Adrenalin asked 10/10, 2016 at 2:40

2

Solved

i want generate Custom Id in JPA it must be primary key of table. there are many examples to create Custom Id using hibernate like this i want same implementation but in JPA.The id must be alphanu...
Uria asked 13/11, 2017 at 7:26

3

I am trying to use Spring Data, Hibernate Envers and auditing in Spring Boot application. I have configured AuditorAwareImpl public class AuditorAwareImpl implements AuditorAware<String> { ...
Fermentation asked 26/5, 2019 at 21:4

3

I have a spring-boot project with spring data. My application.yml contains this property: spring: jpa: hibernate: ddl-auto: update Every time I run the project, Hibernate executes ALTER TABLE s...
Agitato asked 19/6, 2023 at 18:27

2

Solved

I am using a customized ObjectMapper in my spring boot app. I also use the JPA converters for several fields which are stored as JSON strings in the DB. I am not sure how to autowire my custom obje...
Resee asked 26/4, 2016 at 5:24

2

I am trying to create a simple Spring data JPA application and connecting it with PostgreSQL database. Below is my source code and connection properties, import org.springframework.boot.SpringAppli...
Strut asked 1/7, 2021 at 9:43

2

Solved

I already went through the below few links, but it did not solved my problem: Java Jackson: deserialize complex polymorphic object model: JsonMappingException: Unexpected token (START_OBJECT), ex...
Avraham asked 4/8, 2018 at 19:16

3

Solved

In my application I have a model that relates to itself in a parent/child relationship. Posts can have parents that are also posts. I've written a query to delete a target post and its descendants....
Gastronomy asked 16/9, 2016 at 14:17

3

Solved

I have seen various post describing that JPA EntityGraph allows to choose the graph at run time. And I am not entirely clear what this refers to. Out of good faith and respect I would like to take ...
Admittedly asked 18/2, 2022 at 15:2

2

Solved

I have setup two entities like below in a one-to-one mapping and I am trying to query on the joincolumn like below in my repository: @Entity @Table(name = "a") @AllArgsConstructor @NoArgs...
Sunup asked 1/7, 2021 at 16:22

1

Hi I have two different database and I need distributed transaction for my process. Chained transaction manager is deprecated (https://github.com/spring-projects/spring-data-commons/issues/2232) An...
Yuri asked 18/1, 2023 at 8:26

4

Solved

Let's say I want to set a record's column value as "RESOLVED". However, I want to have this value to picked up from an Enum. So the query stays the same regardless if somebody decides the "RESOLVED...
Echoism asked 8/10, 2018 at 7:30

2

Solved

I recently upgraded my Spring Boot app to v3.0 which required Hibernate to be upgraded to v6.1.5.Final. I'm using Spring Data JPA with Hibernate as the JPA provider. When I run the app locally, I w...
Knowable asked 20/12, 2022 at 11:14

6

Solved

Hi what I am trying to achieve is to get SQL native query result map into my DTO in java spring jpa repository, how do I do this properly? I try several code, but it does not work, here is what I t...
Fortress asked 10/11, 2020 at 2:36

6

Solved

I am writing an app with Spring Boot + JPA, using a Postgres database. I have a User Entity and I am trying to get a timestamp when the user record is saved and/or modified. This is not working. Th...
Frequent asked 6/8, 2018 at 14:16

3

I have my multimodule spring boot project. I moved service, entity and repository to the core module and in the war module I have the controller alone. What is the problem here? If I use without J...
Whitherward asked 26/1, 2019 at 20:51

30

Well, I searched Google and found many results, but none of them was able to answer my problem. So, here it goes. I am trying to study Spring MVC and Spring Data JPA by doing a minimal implementat...
Phalange asked 25/10, 2013 at 7:20

10

I have a simple Spring Boot application that connects to a PostgreSQL database and serves as a JSON service. Somehow the startup has become very slow, see timings 10:37:10 and 10:38:00: 2015-05-09...

© 2022 - 2024 — McMap. All rights reserved.