23,297 questions
0
votes
0
answers
14
views
Conjunction vs. null for optional predicates
I'm writing a helper method for a Spring Data JPA Specification and want to handle the case where a filter value is not provided. My goal is for the method to return a "no-op" specification ...
0
votes
0
answers
42
views
How to ensure rollback consistency and scalability when inserting into multiple SQL Server tables using JPA and JDBC in Spring Boot?
I'm working on a system where I need to store processed data across approximately 30 tables in a SQL Server database. For frequently used tables, I'm using JPA, while the majority of the insertions ...
0
votes
1
answer
29
views
Why can CrudRepository.findById() return a Hibernate proxy?
It seems that findById() and manual queries in Spring repositories can return Hibernate proxies instead of real objects if these objects have been "loaded" earlier as lazy fields of other ...
0
votes
0
answers
24
views
A collection with cascade="all-delete-orphan" was no longer referenced by the owning entity instance: ProcedureStep.subSteps
My Java code is throwing the following error:
"A collection with cascade='all-delete-orphan' was no longer referenced by the owning entity instance: br.com.unika.pathdetail.entity.ProcedureStep....
1
vote
1
answer
132
views
Massive performance overhead for @Transactional methods
using a Spring Boot (3.5) service and an Azure hosted MySQL 8 Database I found that we have quite a lot of performance loss when calling methods that are annotated as @org.springframework.transaction....
0
votes
0
answers
17
views
jHipster jakarta.validation.ConstraintViolationException during integration tests
I am trying to get the integration tests of my app running (the app itself seems to be working). The issue seems to be related to how the ID column of a table is defined (I suspect that auto_increment ...
0
votes
0
answers
35
views
Why does Hibernate persist OneToOne entities in the wrong order, causing a foreign key constraint violation when saving nested entities?
I'm having a problem with the Jakarta Persistence API in my Spring Boot project. I'm relatively new to this, so I apologize if this is something really basic.
Here is a simplified version of my ...
0
votes
0
answers
51
views
unable to access h2 console with spring boot 3 app (along with spring cloud gateway)
I have a requirement to create routing to different endpoints using gateway (ended up using spring cloud gateway [reactive stack]).
Upon setting up Spring Boot 3 project with dependencies, when added ...
1
vote
0
answers
27
views
Spring Data JPA find() method triggers insert [duplicate]
I'm building an application using Spring Data JPA and Hibernate. I encountered unexpected behavior: when I'm calling a findBySomeId() method on a repository, it triggers a SQL INSERT on an associated ...
0
votes
0
answers
52
views
Livereload (HotSwapAgent) not working with Spring Boot > 3.5.0, JPA, and Vaadin 24
Spring Boot > 3.5.0 + Spring Data JPA + HotSwapAgent + Vaadin causes injection error
I’ve tried multiple project setups using Vaadin Start, Spring Initializr, and various GitHub example ...
0
votes
1
answer
57
views
Spring Data JPA Interface Projection returns null values
I'm trying to get aggregated data using Spring Data JPA projection
I have two entities — UserEntity (with accountNumber and customerID) and RecordEntity, which has a composite key (accountNumber, ...
0
votes
1
answer
22
views
Delete then create entity using Spring JPA with Hibernate and @Transactional violates unique key constraints
Setup: SpringBoot application using SpringJPA with Hibernate
I have two entities: A and B. Set is a child of A.
I want to remove a B and create another one in a characteristic which would hit a unique ...
0
votes
1
answer
44
views
How to ensure consistency, if both sub and username have to be unique?
I am using Keycloak for authentication in a Spring-Boot backend. If a user with a valid JWT token sends a request, I create a new user in my backend DB if it doesn't exist yet, otherwise I load the ...
1
vote
1
answer
82
views
Obtain next sequence value for a Spring JPA Entity from the allocated IDs cached in Entity Manager?
I have an unusual situation which requires that I obtain unique identifiers from an Oracle sequence without actually saving a row to the table which relies on the sequence.
My entity:
@Table(name = '...
0
votes
0
answers
25
views
StaleObjectStateException while try save entity in multi-tenancy application
I have an application with column-base multi-tenancy.
There was a need to update the dependency version Hibernate 6.3.0.CR1 → 6.6.13.Final. I did everything according to the migration guide.
After the ...