views:

35

answers:

1

Hello everybody

This is my problem. I have a many-to-one relationship from a accountlist to a client

When i want to list accounts with client name, my HQL query ("From accountlist") generates thousands SQL queries, one for the accountlist and one for each client.

Is it possible, with HQL to force to make juste one sql request with a join ?

Thank's you by advance :-)

+3  A: 

Yes. If you are writing a query in HQL:

"from accountlist a join fetch a.client"

or similar. NHibernate's fetch strategies define how this sort of data is retrieved. If you specify to fetch with a JOIN, that's what it does.

David M
nice, it works :-)thank's
eka808