NHibernate mapping change delete command for object
Hi I would like to know how i can change manually change the default sql command to delete an object in the nhibernate mapping file. I want to use开发者_如何学JAVA sevral delete commands at the same time, all using the id, how will I go about that?
http://docs.jboss.org/hibernate/core/3.3/reference/en/html/querysql.html#querysql-cud
Hibernate3 can use custom SQL statements for create, update, and delete operations. The class and collection persisters in Hibernate already contain a set of configuration time generated strings (insertsql, deletesql, updatesql etc.). The mapping tags <sql-insert>, <sql-delete>, and <sql-update> override these strings:
<class name="Person">
<id name="id">
<generator class="increment"/>
</id>
<property name="name" not-null="true"/>
<sql-delete>DELETE FROM PERSON WHERE ID=?</sql-delete>
</class>
精彩评论