There is an entity (1) that has one-to-many associations to other entities (2).
I want to transfer only DTO (1) to the view level, but the fact is that the collections inside this DTO (1) are also DTO (2), and Hibernate, as far as I know, does not know how to load one to many right away as DTO, Because of what, I think, I have only two ways left:
In HQL, write
join fetchand then redo all collections through the loop from Entity to DTOCreate a method that will load the entity (1) of its entity (2) already in the form of a DTO by id, but then I have to run to the database once again
Which of these methods is more correct?