I have an entity called Pessoa
. This entity has a list of phones of the Telefone
entity.
How do I get the person's information and popular that person's phone list in select
with only hql
?
When using the query select u FROM Pessoa
, a lot of data is returned. I would like to optimize and bring only the fields código
, nome
and the phone list.
The expected result would be equal to this:
Thanks for the attention