23,341 questions
- Bountied 0
- Unanswered
- Frequent
- Score
- Trending
- Week
- Month
- Unanswered (my tags)
1
vote
1
answer
70
views
Cannot resolve method findRequiredField in ReflectionUtils
I am trying to update entity fields dynamically using reflection in a Spring Boot application.
I wrote the following code:
public EmployeeDTO updateEmployeeById(Long employeeId, Map<String, Object&...
2
votes
4
answers
120
views
Returned from Postgres timstamptz always in UTC
I'm a little confused.
I have a Spring Boot application (Spring Boot version 4.0.1).
There's a simple DDL:
create table foo (
id serial not null primary key,
dt timestamptz not null
);
And an ...
0
votes
1
answer
100
views
Sort query parameter has no effect when JSON property naming strategy is UpperCamelCase
I use Spring Data REST to expose CRUD endpoints for a JpaRepository. The endpoint on the collection resource provides page, size and sort query parameters. The issue is that sorting doesn't work for ...
1
vote
0
answers
107
views
How to find fragment interface generic type
I am trying to create a custom generic repository using the fragment interface approach as described in this article: https://docs.spring.io/spring-data/jpa/reference/repositories/custom-...
0
votes
0
answers
98
views
How to optimize a complex insurance quotation workflow with multiple dependent validations and API/database calls?
I’m working on enhancing a life insurance quotation workflow using Spring Boot 3 with JPA/Hibernate.
The workflow involves several dependent steps:
Customer eligibility checks
Product → Plan → Rider ...
1
vote
1
answer
118
views
Hibernate: How to keep PostgreSQL enum type up-to-date with Java enum?
I'm building a Spring server program which uses a PostgreSQL database. For one of the table columns, I want to restrict the possible values to a static pre-defined set, so I created a PostgreSQL enum ...
1
vote
1
answer
122
views
is @Transactional(isolation = Isolation.REPEATABLE_READ) enough for safe incrementing?
Is it possible to lost increment here? If not, is it possible in case of read_commited level?
@Transactional
public updateProductStatistics(Long productId) {
ProductStats stats = ...
1
vote
1
answer
92
views
Migration files not executed in test
I have test class which, if configured in this way, works
@DataJpaTest
@AutoConfigureEmbeddedDatabase(
refresh = AutoConfigureEmbeddedDatabase.RefreshMode.BEFORE_EACH_TEST_METHOD,
provider = ...
0
votes
0
answers
65
views
Hibernate doesn't load attribute nodes with entity graph
I have the next entity three:
TestEntity
/ \
FirstNodeEntity SecondNodeEntity
(LIST, LAZY) (LIST, LAZY)
| \
ThirdNodeEntity ...
2
votes
1
answer
182
views
Spring Boot (4.0.0) Cannot Connect to MongoDB in Docker Compose Network
I'm trying to connect my Spring Boot application (using spring-boot-starter-data-mongodb) to a MongoDB instance within a shared Docker network managed by docker-compose.
The connection is failing, and ...
1
vote
1
answer
68
views
Customize spring data jpa repository's query to avoid fetch eager fields
Let's say I have a spring-boot-based project, that uses spring data jpa to define entities and map them to a postgres db.
The entity has some @ManyToOne annotatated "joins" - with eager ...
0
votes
1
answer
56
views
Spring native query (declare..begin..end) with parameters
I have trouble passing parameters for a native query with declare..begin..end style.
This code doesn't work:
@Test
@Transactional
void foo() {
em.createNativeQuery("""
do
...
0
votes
0
answers
72
views
Spring Boot 2.7.x JPA @ManyToOne join returns empty list on GET, but works on POST
In a Spring Boot 2.7.x application with Hibernate/JPA, there are two tables:
tickets
complaint_id (PK, VARCHAR(255))
attachment
complaint_id (FK, VARCHAR(255))
other fields: id, file_name, ...
1
vote
0
answers
74
views
Hibernate Dirty Checking
I'm using Spring Data JPA with an entity that contains a Map<String, String> field.
The map is stored in the database as a TEXT column (JSON string). JPA automatically stores the map as a ...
-3
votes
1
answer
89
views
Converting from Java model to JPA
I have implemented a class User that represents a User (so far either a Student or a Teacher). What they have in common is that they both have IDs, and some information about the user (this is stored ...