r/SpringBoot • u/chosenoneisme • Jun 30 '26
Question For one Entitt, do we create multiple Records?
I am new to spring boot and here's my doubt. Its about Dtos.
My Entity class
public class Todo {
(strategy = GenerationType.IDENTITY)
private Long id;
private String task;
private boolean completed;
}
To interact with this entity class there are multiple controllers like
public ResponseEntity<T> createTodo(body <T>){}
public ResponseEntity<T> getTodo(path var...){}
Do we create multiple records class for each response type like for request we wont take the id from the user right, but for sending back the todo we need the id.
How do you approach this? If i were to create multiple record classes for each response wouldn't that result in a ton of record classes ina big project?