s332361180  

在网上查找很多文章之后做出来了第一个nhibernate程序:

如下是config的配置方法:

<configuration>

<configSections>

  <section name="hibernate-configuration"
          type="NHibernate.Cfg.ConfigurationSectionHandler, NHibernate" />

</configSections>

</configuration>

...

<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
    <session-factory name="NHibernate.TestDatabaseSetup">
      <property name="connection.driver_class">NHibernate.Driver.SqlClientDriver</property>
      <property name="connection.connection_string">
        Server=(local);initial catalog=nhibernate;Integrated Security=SSPI
      </property>
      <property name="dialect">NHibernate.Dialect.MsSql2008Dialect</property>
      <property name='proxyfactory.factory_class'>NHibernate.ByteCode.Castle.ProxyFactoryFactory, NHibernate.ByteCode.Castle</property>
    </session-factory>
  </hibernate-configuration>
红色字体根据自己连接的数据库已经sql版本来进行修改。

posted on 2011-07-19 14:06  s332361180  阅读(348)  评论(0编辑  收藏  举报