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- ...

Get Learning NHibernate 4 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.