title: Nhibernate: QuerySyntaxException: 'Class' is not mapped
body: <p>I have the following class:</p>
  
  <pre><code>public class MyClass
  {
      private List&lt;long&gt; _myList = new List&lt;long&gt;();
  
      public virtual string MyID { get; set; }
  
      public virtual string MyData
      {
          get
          {
              return SomeStaticClass.Serialize(_myList);
          }
          set
          {
              _myList = SomeStaticClass.Deserialize&lt;List&lt;long&gt;&gt;(value);
          }
      }
  
      public virtual List&lt;long&gt; MyList
      {
          get { return _myList; }
      }
  }
  </code></pre>
  
  <p>And the following mapping file:</p>
  
  <pre><code>&lt;hibernate-mapping xmlns="urn:nhibernate-mapping-2.2"
                 assembly="MyNamespace"
                 namespace="MyNamespace"&gt;
    &lt;class name="MyNamespace.MyClass" table="MY_TABLE"&gt;
      &lt;id name="MyID" column="MY_ID" type="System.String"&gt;
        &lt;generator class="assigned"&gt;&lt;/generator&gt;
      &lt;/id&gt;
      &lt;property name="MyData" column="MY_DATA"&gt;&lt;/property&gt;
    &lt;/class&gt;
  &lt;/hibernate-mapping&gt;
  </code></pre>
  
  <p>When I try to run the following line:</p>
  
  <pre><code>session.Delete("From MyClass m");
  </code></pre>
  
  <p>I am getting a QuerySyntaxException with the message "MyClass is not mapped [From MyClass s]".</p>
  
  <p>When I change the name of the "MyID" field to "ID" in the mapping file, the exception becomes</p>
  
  <p>NHibernate.PropertyNotFoundException: Could not find a getter for property 'ID' in class 'MyNamespace.MyClass'.</p>
  
  <p>so I am assuming it can find the mapping file. I made sure that the mapping file is an embedded resource, checked and dobule checked the namespace and class names in the mapping file. What may cause the error? I think it may relate to the MyList property which is not mapped but I am not sure since I am using non-mapped properties on my other classes without a problem.</p>
  
  <p><strong>EDIT:</strong> I tried overriding this class, with a class which has no "MyData" property and redefining "MyList" property as string. I am still receiving the same error for my overridden class.</p>
  
  <p><strong>EDIT 2:</strong> Tried with a very simple class with the same property names with same return types and only simple get; set; blocks. I still get the same error. I am almost sure that nhibernate can see my mapping files because if I change the name of a single property, it gives me PropertyNotFound instead of "class in not mapped".</p>