缂栬瘧姝e父锛岃繍琛屽嚭鐜伴敊璇細
鍏朵粬淇℃伅: 鏈夊涓牴鍏冪礌銆?琛?3锛屼綅缃?2銆?/鎴戞兂鏄痯roduct.hbm.xml鐨勯棶棰?
鎴戠殑product.hbm.xml鏂囦欢濡備笅锛?
<?xml version="1.0" encoding="utf-8" ?> 
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.0" />
<class name="DDLLY.MyDoc.NHibernate.QuickStart.Product,DDLLY.MyDoc.NHibernate.QuickStart" table="products">
<id name="ProductID" column="Product_id" type="Int32" unsaved=0>
<generator class="identity"/>
</id>
<property name="Name" column="name" type="String"/>
    <property name="Spec" column="spec" type="String(100)"/>
    <property name="UnitPrice" column="unit_price" type="Decimal"/>
    <property name="Updated" column="updated" type="DateTime"/>   
</class>
</hibernate-mapping>

解决方案 »

  1.   

    我这乱码,不知道你有什么问题,关于NHibernate可以发消息給DDL讨论:
    http://message.csdn.net/SendMessage.aspx?To=renrenqq
      

  2.   

    或去http://renrenqq.cnblogs.com留言
      

  3.   

    错误如下:
    未处理的“NHibernate.MappingException”类型的异常出现在 nhibernate.dll 中。其他信息: 有多个根元素。 行 3,位置 2。我怀疑是product.hbm.xml文件写错了。但是我看了半天,也没有头绪。
    product.hbm.xml文件内容如下:<?xml version="1.0" encoding="utf-8" ?> 
    <hibernate-mapping xmlns="urn:nhibernate-mapping-2.0">
    <class name="DDLLY.MyDoc.NHibernate.QuickStart.Product,DDLLY.MyDoc.NHibernate.QuickStart" table="products">

    <id name="ProductID" column="product_id" type="Int32" unsaved-value="0">
    <generator class="identity"/>
    </id>
    <property name="Name" column="name" type="String"/>
        <property name="Spec" column="spec" type="String(100)"/>
        <property name="UnitPrice" column="unit_price" type="Decimal"/>
        <property name="Updated" column="updated" type="DateTime"/>   
    </class>
    </hibernate-mapping>
      

  4.   

    To青柳:
    我在http://renrenqq.cnblogs.com留言了,希望你能看到
      

  5.   

    xml只要格式良好形式规范即可,可能是这个xml文件之外的问题,可以发消息給ddl联系下,他nhibernate比较熟.重申:我不是ddl:)