NHibernate QuerySyntaxException

Je suis avec le L'été de NHibernate Série de Screencasts et je suis en cours d'exécution dans une étrange NHibernate Exception.

NHibernate.Hql.Ast.ANTLR.QuerySyntaxException:
Exception of type
'Antlr.Runtime.NoViableAltException' was thrown.
[select from DataTransfer.Person p where p.FirstName=:fn].

J'ai dévié de la Série de Screencasts de la manière suivante:

  1. Cours d'exécution à l'encontre d'un MS SQL Server Compact de Base de données
  2. Je suis à l'aide de MSTest au lieu de MbUnit

J'ai essayé un certain nombre de combinaison de requêtes avec toujours le même résultat. Mon présent CreateQuery syntaxe

public IList<Person> GetPersonsByFirstName(string firstName)
{
    ISession session = GetSession();

    return session.CreateQuery("select from Person p " +
        "where p.FirstName=:fn").SetString("fn", firstName)
        .List<Person>();
}

Pas une question directe cette méthode fonctionne

public Person GetPersonById(int personId)
{
    ISession session = GetSession();
    return session.Get<Person>(personId);
}

Mon hibernate.cfg.xml

<?xml version="1.0" encoding="utf-8" ?>
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
  <session-factory name="BookDb">
    <property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property>
    <property name="connection.driver_class">NHibernate.Driver.SqlServerCeDriver</property>
    <property name="dialect">NHibernate.Dialect.MsSqlCeDialect</property>
    <property name="connection.connection_string">Data Source=C:\Code\BookCollection\DataAccessLayer\BookCollectionDb.sdf</property>
    <property name="show_sql">true</property>
    <property name="proxyfactory.factory_class">NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle</property>
    <mapping assembly="DataTransfer"/>
  </session-factory>
</hibernate-configuration>

Person.hbm.xml

<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="DataTransfer" namespace="DataTransfer">
  <class name="DataTransfer.Person,DataTransfer" table="Person">
    <id name="PersonId" column="PersonId" type="Int32" unsaved-value="0">
      <generator class="native"/>
    </id>
    <property name="FirstName" column="FirstName" type="String" length="50" not-null="false" />
    <property name="LastName" column="LastName" type="String" length="50" not-null="false" />
  </class>
</hibernate-mapping>

source d'informationauteur ahsteele