All Questions
19 questions
3
votes
1
answer
6k
views
Best way to handle lazy models with mapstruct and spring transactional scope
In a typical Java Spring Web APP:
we have the following layers:
Model [DB Models]
Repositories [where you have queries to DB]
Services [Business service where you have the @Transactional annotation]
...
0
votes
1
answer
7k
views
Best practice for references in DTOs and entities in Spring
Given the following architecture and frameworks:
Spring Boot Application with Spring Data JPA (Hibernate is used as OR mapper); layered architecture as followed.
REST layer
Service layer
Persistence ...
-3
votes
1
answer
2k
views
What do you think about DTOs in Spring Data JPA project?
First of all, I am not a junior programmer. I'm just looking for best-practice.
How do you use entities and DTOs into your Spring Data JPA projects?
Assume there is our layers:
Repositories (as ...
0
votes
1
answer
5k
views
In a Spring Boot Project, would you use interfaces for entities or not?
I am currently on the decision, whether to use interfaces throughout my whole spring project or not. I scouted some open source projects and saw, that many big projects are handling that quite ...
0
votes
3
answers
14k
views
Jpa Repository save inside a for loop
I have this requirement:
Csv Upload (using opencsv)
Should display if the record is inserted (if it doesn't exist in the db) or updated (if it exists).
Eg.: 5 records inserted 2 records updated.
...
0
votes
1
answer
174
views
Best way to handle environment specif fields in Hibernate
We have one microservice that will be deployed on two different environments(A and B). There are some common fields and also some are specific to the environment.
Example:
SomeEntity for environment ...
1
vote
0
answers
2k
views
Using import.sql vs persisting JPA entities
In Hibernate ORM & Spring Boot, during the SessionFactory creation, SQL DML statements can be executed to create tables and/or insert data via files such as import.sql defined in the javax....
2
votes
1
answer
7k
views
How to represent and validate website URLs for a JPA entity
I have an application that will allow the user to enter and store (in a DB) a website URL for a company. The only requirement (as of now) beyond entry of the website URL is to validate that the URL is ...
5
votes
6
answers
3k
views
Allowing users to add their own custom fields in a Spring MVC Hibernate application - What's an ideal approach?
We all may have seen applications like JIRA, or many CRM or other applications that allow its users to define their own custom fields to an entity, and do a variety of stuff with it, like making them ...
0
votes
1
answer
2k
views
Decoupled architecture between business and data layers in Spring JPA / Hibernate
I'm using Spring Boot with JPA / Hibernate and I'm trying to decouple the business layer from the data layer. I would like to be able to (relatively easily) switch from a relational database to a rdf ...
7
votes
4
answers
9k
views
Programmatically extending Hibernate table/entity definitions in Spring, how?
I would like to know if there is a way —maybe with AOP— to extend table/entity definitions so that I can add functionality across the board that requires persistence.
Let me explain what I want to do ...
19
votes
1
answer
10k
views
Java application structure: Horizontal vs vertical split
Having a bit of a debate about the starting project structure (using Maven/Eclipse) for a big Java application.
Option 1:
entities (i.e. the whole database using Hibernate classes-first)
services (i....
1
vote
1
answer
827
views
How to properly use Hibernate
I am new to Hibernate so my question could be seen as a very straight forward one, also I will try not to be too generic (as I am always told off because of that), although as with all architectural ...
19
votes
5
answers
65k
views
Do I need to know servlets and JSP to learn spring or hibernate or any other java web frameworks? [closed]
I've been asking a lot of people where to start learning java web development, I already know core java (Threading,Generics,Collections, a little experience with (JDBC)) but I do not know JSPs and ...
7
votes
1
answer
1k
views
Why were annotations introduced in Spring and Hibernate?
I would like to know why were annotations introduced in Spring and Hibernate? For earlier versions of both the frameworks book authors were saying that if we keep configuration in xml files then it ...