NHibernate Integrated Queries Code Review

Define NHibernate Application Configuration

Code Review

Code Walkthrough

The following XML elements are used to configure the NHibernate ISessionFactory object:

<?xml version="1.0" encoding="utf-8" ?> <hibernate-configuration xmlns="urn:nhibernate-configuration-2.2"> <session-factory> <property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property> <property name="dialect">NHibernate.Dialect.MsSql2005Dialect</property> <property name="connection.driver_class">NHibernate.Driver.SqlClientDriver</property> <property name="connection.connection_string">Server=SQLEXPRESS;Initial Catalog=Foo;Integrated Security=SSPI</property> <property name="hibernate.show_sql">False</property> <mapping assembly="PersonNHibernateAdvanced_2_0" /> </session-factory> </hibernate-configuration>
  • connection.provider : NHibernate connection provider.
  • dialect : NHibernate database dialect.
  • connection.driver_class : NHibernate driver class.
  • connection.connection_string : Source database connection string.
  • hibernate.show_sql : whether or not to output the NHibernate generated SQL to the console.
  • mapping assembly : specifies the default .NET namespace to use.