Questions tagged [jpa]
The Java Persistence API (JPA) is a Java specification for accessing, persisting, and managing data between Java objects/classes and a relational database. It is part of the EJB 3.0 specification and is the industry standard approach for Object to Relational Mapping (ORM).
65 questions
0 votes
2 answers
203 views
Keeping the impact of changes low when moving shared domain objects into a library
I’m refactoring a microservice project where multiple services share the same domain objects. Over time, these objects have diverged across services, causing inconsistencies. To solve this, I plan to ...
2 votes
2 answers
769 views
How should I implement data access with jpa to meet Clean Architecture/DDD
For the last few days I'm searching any information about compatibility of JPA and Clean Architecture/DDD. I found next ideas for decoupling application from hibernate. Do not use @ManyToMany or @...
0 votes
0 answers
156 views
factory methods in JPA entity classes. anti pattern?
I started using factory methods in JPA Entity classes. But I'm not sure if it's an anti-pattern. If it is , then where do I place them instead ? A similar sample is below @Builder @Entity Class ...
0 votes
0 answers
584 views
How to pass the entity's domain to the repository layer - clean architecture and spring JPA
According to Should I use a layer between service and repository for a clean architecture - Spring the Peristance layer is deprecated because the Repository is already an abstraction. UML solution of ...
0 votes
1 answer
564 views
How to define API notations for multiple tables data in the response
The question is specific to the API notation shown in the screen under the heading Table Name with the comment Joins Multiple Tables. I am using Spring Boot with JPA (Database: RDBMS) I have defined ...
0 votes
3 answers
336 views
How best to structure my Service/Repository layers when persisting a Many to One object?
I'm working on a project where I need to do CRUD operations on Book and Library objects. Naturally the relationship between Book and Library is Many to One, like so: @Entity @Getter @Setter @...
-2 votes
1 answer
117 views
Entity objects with data external to the database
I'm looking for design patterns to model (java) objects that are partially stored in a database and partially stored some other external source. In my case the external data is a whole lot of files ...
2 votes
3 answers
309 views
Pattern for syncing databases with undo option
I work on a large and old application consisting of a server and a fat client. Part of what the application does is handle a large-ish (a few 100MBs) database of frequently changing data (~a dozen ...