我不明白为什么这个简单的查询没有创建。我从一个测试中调用这个方法,它会抛出一个异常,抱怨第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列
有什么建议吗?
感谢