Skip to content
Advertisement

Tag: spring-data-jpa

@ResponseBody returns empty object

When I use below to get the user object it works just fine. Above gives me a response back as: Now, I am trying to search based on UUID(4) using this: This doesn’t return anything. No error, no warning whatsoever. While this gives me all the details I need: This is what I have in my Repository and Entity Question:

Stack overflow error for hibernate one-to-one mapping with Spring Data JPA

My problem is similar to this one https://discourse.hibernate.org/t/hibernate-throws-org-hibernate-id-identifiergenerationexception-attempted-to-assign-id-from-null-one-to-one-property/1777 but I am getting a different exception after applying the answer from this thread. My entities: Controller with corresponding Spring Data Repository: With this payload: I am getting an endless nested response with proper fields(distributor -> location -> distributor -> location ..), which ends with SO Error: I can’t fathom why does

JPA @PreUpdate @Persist seems not working as expected

I have a problem for filling auditing fields by using @PreUpdate and @PrePersist. For instance When I’d like to update a client entity, the field updatedBy and updatedAt are still null; despite when I debug, the code of preUpdate() which is annotated with @PreUpdate is executed. Below the code of AuditingField which is responsible for creating/updating the auditing fields in

how do i fetch derived/calculated column from database view or Procedure in Spring Boot using JPA/Hibernate and use it along with predefined columns?

I am working on a project as am learning Spring Boot with JPA,Hibernate with Mustache as for templates. i managed to create a view with one calculated column which calculates an remaining days from issueDate and expiryDate. the view works fine and i am able to display all columns except the calculated column. I need help figuring out how to

Using Spring data JPA EntityGraph with LAZY load mode for NamedAttributeNode field

I am facing with 2 problems: N + 1 query and Out Of Memory (OOM). I solved OOM by paging and lazy loading: But when I use lazy loading, N + 1 query happened. So I try to use EntityGraph as https://www.baeldung.com/spring-data-jpa-named-entity-graphs. But as my researches and local test, EntityGraph always do eager loading for NamedAttributeNode field – association field,

Advertisement