开发者

nHibernate Join syntax error

开发者 https://www.devze.com 2023-01-05 05:43 出处:网络
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, si

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>();
}


You are missing the right parenthesis.

0

精彩评论

暂无评论...
验证码 换一张
取 消