If you look back at our initial configuration in code, you will notice that there are five configuration options that we set. They are ConnectionProvider
, Dialect
, ConnectionDriver
, ConnectionString
, and ProxyFactoryFactoryClass
. All of these elements have a property called name
that we will use to set the value. We will set the same properties in the configuration file.
The property ConnectionDriver
is usually not needed because setting the dialect
will take care of driver settings using a sensible default.
These settings provide the basic information that NHibernate needs to get up and running. I like to call these the "Big 4 plus 1 (the mapping assembly)".
The
ConnectionProvider
property tells NHibernate what method it needs to use to build connections. This is usually set to "NHibernate.Connection.DriverConnectionProvider
", but other providers can be used by providing the full classname of the provider (as shown) or adding the assembly name if it resides outside...