【发布时间】:2010-04-16 17:44:12
【问题描述】:
我是 NHibernate 的新手,现在才刚刚开始。
我有一个非常简单的表,包含 Id(Int 主键和自动递增)、名称(varchar(100))、描述(varchar(100))
这是我的 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"/>
这是我想要获取所有记录的方式
public List<DevelopmentStep> getDevelopmentSteps()
{
List<DevelopmentStep> developmentStep;
developmentStep = Repository.FindAll<DevelopmentStep>(new OrderBy("Name", Order.Asc));
return developmentStep;
}
但我遇到了异常
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'.
请给我建议---谢谢
【问题讨论】:
标签: asp.net nhibernate fluent-nhibernate