Class ObjectOptimisticLockingFailureException

All Implemented Interfaces:
Serializable
Direct Known Subclasses:
HibernateOptimisticLockingFailureException, JpaOptimisticLockingFailureException

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:
  • Constructor Details

    • ObjectOptimisticLockingFailureException

      public ObjectOptimisticLockingFailureException(@Nullable String msg, @Nullable Throwable cause)
      Create a general ObjectOptimisticLockingFailureException with the given message, without any information on the affected object.
      Parameters:
      msg - the detail message
      cause - the source exception
    • 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, @Nullable Throwable cause)
      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
      cause - the source exception
    • ObjectOptimisticLockingFailureException

      public ObjectOptimisticLockingFailureException(Class<?> persistentClass, @Nullable Object identifier, String msg, @Nullable Throwable cause)
      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 - the detail message
      cause - the 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, @Nullable Throwable cause)
      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
      cause - the source exception
    • ObjectOptimisticLockingFailureException

      public ObjectOptimisticLockingFailureException(String persistentClassName, @Nullable Object identifier, @Nullable String msg, @Nullable Throwable cause)
      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 - the detail message
      cause - the source exception
  • Method Details

    • getPersistentClass

      @Nullable 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

      @Nullable 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

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