I am doing my first nHibernate Join. In my function below, I want to return a list of records for the specified query. Normally my List type is the class representing the database table. In this case, since I am doing a join, I created a custom class that only contains the fields for the columns I am retrieving from the database. However, when I create the Query, I get "ERROR: 42601: syntax error at end of input" which seems to be related to the use of ReportColumns. Can someone tell me if what I am doing is possible, and if not how this can be done?
public IList<ReportColumns> FetchRecords(NHibernateDBConnection db, string MyName)
{
return db.Session
.CreateQuery("SELECT s.RunNumber, s.TestStarted, s.StationName, t.Name FROM MyTable1 s, MyTable2 t WHERE (s.RunNumber = t.RunNumber AND t.Name = :MyName")
.SetParameter("MyName", MyName)
.List<ReportColumns>();
}