XML configuration
XML configuration, such as XML mapping is the first and original method of configuring NH. In this method, all configuration options are declared through XML elements inside either application configuration file or a separate file having extension .cfg.xml
. A config
section that is handled by NHibernate.Cfg.ConfigurationSectionHandler
needs to be added to application configuration for NHibernate configuration to be processed successfully. All configuration options we discussed at the beginning of the chapter are declared using XML as follows:
<configuration> <configSections> <section name="hibernate-configuration" type="NHibernate.Cfg.ConfigurationSectionHandler,NHibernate"/> </configSections> <hibernate-configuration xmlns="urn:nhibernate-configuration- 2.2"> <session-factory> <property name="dialect">NHibernate.Dialect.SQLiteDialect</property> <property...