have a contact entity and an institution entity. The contact has a one-to-one relationship with institution...
Code:
<one-to-one name="Institution" cascade="all-delete-orphan" class="Project.Core.Institution,Project.Core" lazy="proxy" />
When I retrieve ALL Contacts. A separate query is being run for each record return which queries the institution entity based on the ID. So if there are 10 contacts. There are 11 queries being run. Here is my HQL...
Code:
NHibernateSession.CreateQuery("select c from Contact c fetch join c.Institution i")
.List<Contact>() as List<Contact>;
I've tried a number of variations, but am not able to solve the situation. Can anyone provide help as to what I may be doing wrong?