I've read tons of posts about the class mapping xml metadata and tons about the database configuration xml data, but I have not been able to find topics about combining both pieces of metadata into one xml file.
I know the
<hibernate-configuration> node offers a child node to import an assembly containing the class mapping xml metadata, but is there not a way to nest the
<hibernate-mapping> node within the
<hibernate-configuration> ?
An example(that does not work) might be:
Code:
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
<session-factory name="xyz">
<!-- properties -->
<property name="connection.provider">NHibernate.Connection.DriverConnectionProvider</property>
<property name="connection.driver_class">NHibernate.Driver.SqlClientDriver</property>
<property name="connection.connection_string">Server=localhost;initial catalog=nhibernate;User Id=;Password=</property>
<property name="show_sql">false</property>
<property name="dialect">NHibernate.Dialect.MsSql2000Dialect</property>
<property name="use_outer_join">true</property>
<hibernate-mapping>
<class name="BusinessEntities.Class, Assembly" table="SalesOrder">
<id name="OrderId" column="SalesOrderId" type="String" length="20">
<generator class="assigned" />
</id>
<property name="ItemNumber" column="ItemNumber" type="String" length="40"/>
</class>
</hibernate-mapping>
</session-factory>
</hibernate-configuration>
or something along these lines..... So the final affect would be to give the Configuration.Configure() method
one file.
thanks