Regular |
 |
Joined: Tue Feb 07, 2006 4:27 pm Posts: 69
|
I have used HQL to retrieve fields from multiple tables before. The following example gets the ProjectName from the Project table and
retrieves a complete persistent object (LegalLandDescription) from another table.
public IList ListAllProjectsUsingFilter(ProjectFilterDto filter) { string hsqlQuery = "SELECT p.ProjectName, elements(l.LegalLandDescriptions) " + " FROM Domain.Project p " + " INNER JOIN p.ProjectClasses c " + " INNER JOIN c.Locations l " + " INNER JOIN FETCH l.LegalLandDescriptions ll";
return TransactionManager.Instance.ExecuteHSql(hsqlQuery); }
Hope this little sample helps.
|
|