Hi Guys,
I'm trying to write a dynamic sql-query which contains a join which needs to be used within the where clause, but doesn't need to be returned, but i seem to be having problems.
The sql being denerated is currently looking like this:
Code:
SELECT {h.*} FROM Hotel {h}, Room {r} WHERE 1=1 AND {r.Capacity} BETWEEN 10 AND 100 ORDER BY {h.Holindex} ASC
With a generate sql statement as follows:
Code:
IQuery query = NHibernateSession.CreateSQLQuery(sql.ToString())
.AddEntity("h", typeof(Hotel))
.AddJoin("r", "h.Rooms");
But no matter what i try, i keep getting erros like
Quote:
No column name found for property [Capacity] for alias [r]
Does anybody have any ideas?