I am using code generation to create my C# entity classes from the hbm mappings, and I wish to 'extend' the mapping config to describe customizations to the generator.
My Xml looks something like this (see below)
but when loading the mappings, nhibernate throws and exception about my
http://custom/generator/customattribute 'attribute' 'not being declared'
This is because (I believe) there is no schema available for this namespace, and NHibernate is doing strict schema validation.
Would this not be a desirable feature? To be able to 'extend' the mapping xml without it affecting NHibernate (NHibernate should just ignore anything not in its expected namespaces).
How might I achieve this?
Thanks!
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" default-lazy="false" xmlns:p="http://custom/generator">
<!--
@System.Runtime.Serialization.DataContract
-->
<class name="Episode" discriminator-value="0">
<!--
@System.Runtime.Serialization.DataMember
-->
<id name="Id" column="Id" type="System.Int32" unsaved-value="0">
<generator class="increment" />
<!-- unsaved-value used to be null and generator was increment in h2.0.3 -->
</id>
<property p:customattribute="true" name="Duration" type="System.Int32">
<column name="Duration" />
</property>
</class>
</hibernate-mapping>