23,326 questions
0
votes
0
answers
87
views
DockerHub: Unable to open JDBC Connection for DDL execution [Could not create connection to database server]
I am learning SpringBoot and I'm making an application that need to connect to a Springboot API. I don't have problem when running my API locally, but when I use Docker it fails to find the database.
...
2
votes
1
answer
105
views
Spring TransactionTemplate joins the Transaction of unknown origin
'org.springframework.boot' version '3.3.13'
I have a simple Task framework.
public class TaskRunner implements DelayedTaskRunner {
private static final String TASK_WORKER_THREAD_NAME_PATTERN = &...
3
votes
0
answers
62
views
Problem with @JoinFormula with fixed value
In my Spring Boot 3, Hibernate 6.6.42 project I have the following two entities:
@Getter
@Setter
@Entity
@Table(name = "ATTACHMENT")
public class Attachment implements Serializable {
...
1
vote
1
answer
128
views
How do I delete an entity in a one-to-many relationship?
I'm implementing a small e-commerce system, but I've encountered the following problem: I can't delete entities with one-to-many relationships.
I have a shopping cart class that goes as follow:
@...
4
votes
1
answer
148
views
Hibernate Cache causing OOM. Cache not showing (deleted) entities that are cached
I solved my Problem. I just dont really understand why Hibernate ist not showing its cache entries.
I had the following representation that caused an OOM in my service while deleting lots of Entities.
...
1
vote
1
answer
113
views
At time of creating table in postgresql database without mentioning the schema name. What it will take name of schema?
At time of creating table in postgresql database without mentioning the schema name. What it will take as a reference for name of schema?
-3
votes
1
answer
75
views
I can't make relationships on spring boot
I was trying to make an ecommerce api with Spring boot. I was using Spring data jpa for my models and relationships. But for some reason I can't make this one to many relationship.
I have a category ...
Best practices
0
votes
6
replies
160
views
Should I implement UserDetails directly in my User entity or create a separate UserPrincipal class in Spring Security?
I am building a Spring Boot application with Spring Security and JPA. I have seen two approaches for implementing UserDetails and I am confused about which one to use and why.
Approach 1:
@Entity
@...
Best practices
1
vote
4
replies
97
views
Transaction Management Multiple levels
We have:
Create Controller
Create Service
Propose Controller
Propose Service
Each controller executes the corresponding service.
The Create Service will create two instances of different entities. ...
Best practices
0
votes
3
replies
144
views
DDD java - where do i put authorization in this case?
Question
I'm learning DDD in a puristic way and I’m building a Project Management app.
Aggregate root: Project
Project has a manager (Employee) and a list of tasks.
Each task is assigned to an ...
Best practices
0
votes
4
replies
93
views
SpringBoot JPA Entity Manager flush and clear functions helps in importing large data sets faster
I worked on a performance improvement of importing large dataset in SpringBoot JPA.
I Implemented batching of the records that I am saving to database and flushing and clearing the entity manager on ...
0
votes
0
answers
81
views
Why does JPA defer UPDATE statements until transaction commit regardless of database isolation level?
In JPA, when an entity is modified inside a transaction (e.g., via a setter), the change is tracked only in the persistence context through dirty checking, and the actual UPDATE SQL is sent to the ...
0
votes
1
answer
85
views
Spring JPA Query as native query with alias and params
Trying to do something simple, but continue to stumble on errors.
I have a MyRepository extends JpaRepository, where I have (I gave Criteria a go, but am now rewriting the whole thing) a native query ...
Tooling
0
votes
7
replies
50
views
Recommendations Java -Jakarta EE New web app - api
I used to do Java back in the day (2013) and I am SCJP. Since then I have been doing mobile. Anyway, I was asked to do an API for someone so I figured I’d get back into it for a bit and everything ...
1
vote
1
answer
161
views
Testcontainers init script fails on DB initialized by liquibase
Spring-boot application with liquibase managed postgres DB, trying to get @DataJpaTest working with Testcontainers.
The tests work in general - I can launch it, liquibase initialises the DB, and I can ...