Spring.NET 1.3.0 RC1 for .NET 2.0 API Reference

HibernateTemplate.Delete(Object, LockMode) Method

Delete the given persistent instance.

[Visual Basic]
Public NotOverridable Overloads Sub Delete( _
   ByVal entity As Object, _
   ByVal lockMode As LockMode _
) _
    Implements ICommonHibernateOperations.Delete
[C#]
public void Delete(
   object entity,
   LockMode lockMode
);

Parameters

entity
Tthe persistent instance to delete.
lockMode
The lock mode to obtain.

Implements

ICommonHibernateOperations.Delete

Remarks

Obtains the specified lock mode if the instance exists, implicitly checking whether the corresponding database entry still exists (throwing an OptimisticLockingFailureException if not found).

Exceptions

Exception Type Condition
DataAccessException In case of Hibernate errors

See Also

HibernateTemplate Class | Spring.Data.NHibernate.Generic Namespace | HibernateTemplate.Delete Overload List