org.springframework.orm
Class ObjectOptimisticLockingFailureException

java.lang.Object
  extended by java.lang.Throwable
      extended by java.lang.Exception
          extended by java.lang.RuntimeException
              extended by org.springframework.core.NestedRuntimeException
                  extended by org.springframework.dao.DataAccessException
                      extended by org.springframework.dao.ConcurrencyFailureException
                          extended by org.springframework.dao.OptimisticLockingFailureException
                              extended by org.springframework.orm.ObjectOptimisticLockingFailureException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
HibernateOptimisticLockingFailureException, HibernateOptimisticLockingFailureException, JdoOptimisticLockingFailureException, TopLinkOptimisticLockingFailureException

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(Class persistentClass, Object identifier)
          Create a new ObjectOptimisticLockingFailureException for the given object, with the default "optimistic locking failed" message.
ObjectOptimisticLockingFailureException(Class persistentClass, Object identifier, String msg, Throwable ex)
          Create a new ObjectOptimisticLockingFailureException for the given object, with the given explicit message.
ObjectOptimisticLockingFailureException(String persistentClassName, Object identifier)
          Create a new ObjectOptimisticLockingFailureException for the given object, with the default "optimistic locking failed" message.
ObjectOptimisticLockingFailureException(String persistentClassName, Object identifier, String msg, Throwable ex)
          Create a new ObjectOptimisticLockingFailureException for the given object, with the given explicit message.
 
Method Summary
 Object getIdentifier()
          Return the identifier of the object for which the locking failed.
 Class getPersistentClass()
          Return the persistent class of the object for which the locking failed.
 String getPersistentClassName()
          Return the name of the persistent class of the object for which the locking failed.
 
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, 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(Class persistentClass,
                                               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(Class persistentClass,
                                               Object identifier,
                                               String msg,
                                               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

ObjectOptimisticLockingFailureException

public ObjectOptimisticLockingFailureException(String persistentClassName,
                                               Object identifier)
Create a new ObjectOptimisticLockingFailureException for the given object, with the default "optimistic locking failed" message.

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

ObjectOptimisticLockingFailureException

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

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

getPersistentClass

public Class getPersistentClass()
Return the persistent class of the object for which the locking failed. If no Class was specified, this method returns null.


getPersistentClassName

public String getPersistentClassName()
Return the name of the persistent class of the object for which the locking failed. Will work for both Class objects and String names.


getIdentifier

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



Copyright (c) 2002-2005 The Spring Framework Project.