Does the <map> element support custom SQL. Can I not put a <sql-insert> element in it?
I've looked at the nhibernate-mapping.xsd and it shows that <sql-insert> is a valid child of <map>.
However when I try to use it I get an error:
Code:
XML validation error: The element 'map' in namespace 'urn:nhibernate-mapping-2.2' has invalid child element 'sql-insert' in namespace 'urn:nhibernate-mapping-2.2'. List of possible elements expected: 'urn:nhibernate-mapping-2.2:meta urn:nhibernate-mapping-2.2:jcs-cache urn:nhibernate-mapping-2.2:cache urn:nhibernate-mapping-2.2:key'.
Which says quite clearly that is it not..... Am I missing something obvious? I really dont want to have to use an "INSTEAD OF" trigger. (I need to do this as NHibernate is updating a field in the view that is read-only)
Here is my mapping file
Code:
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
<class name="Test,Base" table="Test">
<id name="Id" column="tstId" type="Int32" unsaved-value="0">
<generator class="native"/>
</id>
...
<map name="Parameters" table="vwTestInfo" lazy="false" inverse="false" cascade="all" >
<sql-insert>
insert into ....
</sql-insert>
</map>
</class>
Thanks
Andre