org.springframework.orm
Class ObjectOptimisticLockingFailureException

java.lang.Object
  extended byjava.lang.Throwable
      extended byjava.lang.Exception
          extended byjava.lang.RuntimeException
              extended byorg.springframework.core.NestedRuntimeException
                  extended byorg.springframework.dao.DataAccessException
                      extended byorg.springframework.dao.OptimisticLockingFailureException
                          extended byorg.springframework.orm.ObjectOptimisticLockingFailureException
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
HibernateOptimisticLockingFailureException

public class ObjectOptimisticLockingFailureException
extends OptimisticLockingFailureException

Exception thrown on an optimistic locking violation for a mapped object. Provides information about the persistent class and the identifier.

Since:
13.10.2003
Author:
Juergen Hoeller
See Also:
Serialized Form

Constructor Summary
ObjectOptimisticLockingFailureException(java.lang.Class persistentClass, java.lang.Object identifier)
          Create a new ObjectOptimisticLockingFailureException for the given object, with the default "optimistic locking failed" message.
ObjectOptimisticLockingFailureException(java.lang.Class persistentClass, java.lang.Object identifier, java.lang.String msg, java.lang.Throwable ex)
          Create a new ObjectOptimisticLockingFailureException for the given object, with the given explicit message.
 
Method Summary
 java.lang.Object getIdentifier()
          Return the identifier of the object for which the locking failed.
 java.lang.Class getPersistentClass()
          Return the persistent class of the object for which the locking failed.
 
Methods inherited from class org.springframework.core.NestedRuntimeException
getCause, getMessage, printStackTrace, printStackTrace
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getStackTrace, initCause, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ObjectOptimisticLockingFailureException

public ObjectOptimisticLockingFailureException(java.lang.Class persistentClass,
                                               java.lang.Object identifier)
Create a new ObjectOptimisticLockingFailureException for the given object, with the default "optimistic locking failed" message.

Parameters:
persistentClass - the persistent class
identifier - the ID of the object for which the locking failed

ObjectOptimisticLockingFailureException

public ObjectOptimisticLockingFailureException(java.lang.Class persistentClass,
                                               java.lang.Object identifier,
                                               java.lang.String msg,
                                               java.lang.Throwable ex)
Create a new ObjectOptimisticLockingFailureException for the given object, with the given explicit message.

Parameters:
persistentClass - the persistent class
identifier - the ID of the object for which the locking failed
msg - exception message
ex - source exception
Method Detail

getPersistentClass

public java.lang.Class getPersistentClass()
Return the persistent class of the object for which the locking failed.


getIdentifier

public java.lang.Object getIdentifier()
Return the identifier of the object for which the locking failed.



Copyright (C) 2003-2004 The Spring Framework Project.