Exception when retrieving record using Nhibernate

Posted by Muhammad Akhtar on Stack Overflow See other posts from Stack Overflow or by Muhammad Akhtar
Published on 2010-04-16T09:42:09Z Indexed on 2010/04/16 9:43 UTC
Read the original article Hit count: 246

I am new to NHibernate and have just started right now.

I have very simple table contain Id(Int primary key and auto incremented), Name(varchar(100)), Description(varchar(100))

Here is my XML

<class name="DevelopmentStep" table="DevelopmentSteps" lazy="true">
<id name="Id" type="Int32" column="Id">
</id>
<property name="Name" column="Name" type="String" length="100" not-null="false"/>
<property name="Description" column="Description" type="String" length="100" not-null="false"/>

here is how I want to get all the record

 public List<DevelopmentStep> getDevelopmentSteps()
   {
       List<DevelopmentStep> developmentStep;
       developmentStep = Repository.FindAll<DevelopmentStep>(new OrderBy("Name", Order.Asc));
       return developmentStep;
   } 

But I am getting exception

The element 'id' in namespace 'urn:nhibernate-mapping-2.2' has incomplete content. List
 of possible elements expected: 'urn:nhibernate-mapping-2.2:meta urn:nhibernate-mapping-
2.2:column urn:nhibernate-mapping-2.2:generator'.

Please Advise me --- Thanks

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about fluent-nhibernate