Can someone please help me understand how to configure hibernate to do what i want.
I have a parent entity \"Appartment\" with a List of \"Room\"s as children. I hav
This is really simple. No need to repopulate your children, or create separate DTO's.
If you are never going to persist the children just add insertable=false, updatable=false to your joincolumn annotation. Like this:
@OneToMany
@JoinColumn (name = "appartmentId", insertable = false, updatable = false)
@Fetch(value = FetchMode.JOIN)
private List room;