The only work I found is shown in the code snippet below using Fluent NHibernate. This is ugly as it is hard SQL coding in your mapping, but it really works. The Check property is set to None, so the counters are ignored. I don't know if you can accomplish this using direct HBM files, but there is probably a way. It would be great if NHibernate (or Fluent NH) had a configuration option to either set the expected updated row counter or ignore it if necessary.
public class OrderMap : ClassMap<Order> { public OrderMap() { Id(c => c.Id, "order_id").GeneratedBy.Native(); Table("order"); Map(c => c.GroupId, "group_id"); Map(c => c.Status, "status"); Map(c => c.LocationNumber, "location"); SqlInsert("insert into order (group_id, status, location) values (?, ?, ?)").Check.None(); SqlUpdate("update order set group_id = ?, status = ?, location = ? where order_id = ?")).Check.None(); SqlDelete("delete order where order_id = ?").Check.None(); } }
EDIT: For those unfortunate people who don't know about Fluent NHibernate or love the painful generation of HBM files manually, here is the HBM file for this sample:
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" default-access="property" auto-import="true" default-cascade="none" default-lazy="true"> <class xmlns="urn:nhibernate-mapping-2.2" mutable="true" name="Your.DomainModel.Entities.Order, Your.DomainModel, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" table="order"> <id name="Id" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" unsaved-value="0"> <column name="order_id" /> <generator class="identity" /> </id> <property name="GroupId" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <column name="group_id" /> </property> <property name="Status" type="System.Int16, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <column name="status" /> </property> <property name="LocationNumber" type="System.Int32, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"> <column name="loc_num" /> </property> <sql-insert check="none">insert into order (group_id, status, location) values (?, ?, ?)</sql-insert> <sql-update check="none">update order set group_id = ?, status = ?, location = ? where order_id = ?</sql-update> <sql-delete check="none">delete order where order_id = ?</sql-delete> </class> </hibernate-mapping>