测试程序之前使用nhibernate 1.2 可以正常使用,将nhibernate 更换为2.1版本后,程序报错:Could not compile the NHibernateDemo.Product.hbm.xml mapping document:
弄了好几天了,总是报错,请各位大侠帮忙&……xml文件为:
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="NHibernateDemo" >  <class name="Product" table="Product">
    <id name="Pro_id" type="String" >
      <column name="Pro_id" length="10" />
      <generator class="native" />
    </id>
    <property name="Pro_name" type="String">
      <column name="Pro_name" length="20" />
    </property>
    <property name="Pro_price" type="float">
      <column name="Pro_price" />
    </property>
   </class>
</hibernate-mapping>
--------------------------------------------------------------------------------------------------------
持久化类为:
using System;
using System.Collections.Generic;
using System.Text;namespace NHibernateDemo.Example
{
    public class Product
    {
        private string pro_id;
        private string pro_name;
        private float pro_price;
        //注NHibernate2.0需要属性为virtual        public virtual string Pro_id {
            get { return pro_id; }
            set { pro_id = value; }
        }        public virtual string Pro_name
        {
            get { return pro_name; }
            set { pro_name = value; }
        }        public virtual float Pro_price
        {
            get { return pro_price; }
            set { pro_price = value; }
        }    }------------------------------------------------------------------------------------------------配置文件:
<?xml version="1.0" encoding="utf-8"?>
<!-- 
This template was written to work with NHibernate.Test.
Copy the template to your NHibernate.Test project folder and rename it in hibernate.cfg.xml and change it 
for your own use before compile tests in VisualStudio.
-->
<!-- This is the System.Data.OracleClient.dll provider for Oracle from MS -->
<hibernate-configuration  xmlns="urn:nhibernate-configuration-2.2" >
<session-factory name="NHibernate.Test">
<property name="connection.driver_class">NHibernate.Driver.OracleClientDriver</property>
<property name="connection.connection_string">
User ID=hh;Password=hh;Data Source=hh
</property>
<property name="show_sql">false</property>
<property name="dialect">NHibernate.Dialect.OracleDialect</property>
<property name="query.substitutions">true 1, false 0, yes 'Y', no 'N'</property>
<property name="proxyfactory.factory_class">NHibernate.ByteCode.LinFu.ProxyFactoryFactory, NHibernate.ByteCode.LinFu</property>
</session-factory>
</hibernate-configuration>