我不明白爲什麼這個簡單的查詢沒有創建。我從一個測試中調用這個方法,它會拋出一個異常,抱怨第1行第7列,在那裏我看不到任何錯誤。爲什麼Nhibernate無法爲我創建這個簡單的查詢?
public IList<Continent> GetContinentByName(string name)
{
ISession session = GetSession();
IQuery query =
session.CreateQuery("select from Continent where Continent.ContinentShort='Atlantis'");
// (........) Next step will be getting the list from the query if I can make it work
我得到以下
的TestCase ANTLR異常 'M:DataAccessLayer.HibernateDataProvider.GetContinentByName(System.String)' 失敗:類型Antlr.Runtime.NoViableAltException「引發的異常。靠近第1行第7列 NHibernate.Hql.Ast.ANTLR.QuerySyntaxException:拋出了類型爲'Antlr.Runtime.NoViableAltException'的異常。靠近第1行第7列
有什麼建議嗎?
感謝