If you map the reverse relation in the Commande
entity ...
public class Commande {
...
@ManyToOne(mappedBy="commande")
private Client client;
// getter and setter ...
}
(Here, mappedBy
is getting the name of the @OneToMany
property set up at the
other side of the relationship)
Then after executing your query SELECT c FROM Commande c
you would get a list of Commande
objects, and for each one of them you could get the name of the client using: thisCommande.getClient().getName()
.