4
I am wanting to store the data of my program via ORM and am separating cute each object.
My User object, for example, has its basic attributes and is also composed of other objects such as Address, Contact and Access.
Each object has an ID attribute, for identification and association...
My doubt is the following, in the constructor method of each class(User, Address, Contact and Access) Should I pass the corresponding id or only the other attributes? Because I think, suddenly Hibernate can assign the correct ID.
Public Class Cliente
private long Id;
private String Nome;
Public Cliente(Long id,String Nome){}
'ou
Public Cliente(String Nome){}
'?