Top Description Fields Constructors Methods
org.springframework.orm

public Class ObjectOptimisticLockingFailureException

extends OptimisticLockingFailureException
Class Inheritance
Known Direct Subclasses
org.springframework.orm.hibernate5.HibernateOptimisticLockingFailureException, org.springframework.orm.jpa.JpaOptimisticLockingFailureException
Annotations
@SuppressWarnings:serial
Imports
org.springframework.dao.OptimisticLockingFailureException, org.springframework.lang.Nullable

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

Field Summary

Modifier and TypeField and Description
private final Object
private final Object

Constructor Summary

AccessConstructor and Description
public
ObjectOptimisticLockingFailureException(String
the detail message
msg
,
Throwable
the source exception
cause
)

Create a general ObjectOptimisticLockingFailureException with the given message, without any information on the affected object.

public
ObjectOptimisticLockingFailureException(Class<?>
the persistent class
persistentClass
,
Object
the ID of the object for which the locking failed
identifier
)

Create a new ObjectOptimisticLockingFailureException for the given object, with the default "optimistic locking failed" message.

public
ObjectOptimisticLockingFailureException(Class<?>
the persistent class
persistentClass
,
Object
the ID of the object for which the locking failed
identifier
,
Throwable
the source exception
cause
)

Create a new ObjectOptimisticLockingFailureException for the given object, with the default "optimistic locking failed" message.

public
ObjectOptimisticLockingFailureException(Class<?>
the persistent class
persistentClass
,
Object
the ID of the object for which the locking failed
identifier
,
String
the detail message
msg
,
Throwable
the source exception
cause
)

Create a new ObjectOptimisticLockingFailureException for the given object, with the given explicit message.

public
ObjectOptimisticLockingFailureException(String
the name of the persistent class
persistentClassName
,
Object
the ID of the object for which the locking failed
identifier
)

Create a new ObjectOptimisticLockingFailureException for the given object, with the default "optimistic locking failed" message.

public
ObjectOptimisticLockingFailureException(String
the name of the persistent class
persistentClassName
,
Object
the ID of the object for which the locking failed
identifier
,
Throwable
the source exception
cause
)

Create a new ObjectOptimisticLockingFailureException for the given object, with the default "optimistic locking failed" message.

public
ObjectOptimisticLockingFailureException(String
the name of the persistent class
persistentClassName
,
Object
the ID of the object for which the locking failed
identifier
,
String
the detail message
msg
,
Throwable
the source exception
cause
)

Create a new ObjectOptimisticLockingFailureException for the given object, with the given explicit message.

Method Summary

Modifier and TypeMethod and Description
public Object
getIdentifier()

Return the identifier of the object for which the locking failed.

public Class<?>
getPersistentClass()

Return the persistent class of the object for which the locking failed.

public String
getPersistentClassName()

Return the name of the persistent class of the object for which the locking failed.

Field Detail

identifierback to summary
private final Object identifier
Annotations
@Nullable
persistentClassback to summary
private final Object persistentClass
Annotations
@Nullable

Constructor Detail

ObjectOptimisticLockingFailureExceptionback to summary
public ObjectOptimisticLockingFailureException(String msg, Throwable cause)

Create a general ObjectOptimisticLockingFailureException with the given message, without any information on the affected object.

Parameters
msg:String

the detail message

cause:Throwable

the source exception

ObjectOptimisticLockingFailureExceptionback to summary
public ObjectOptimisticLockingFailureException(Class<?> persistentClass, Object identifier)

Create a new ObjectOptimisticLockingFailureException for the given object, with the default "optimistic locking failed" message.

Parameters
persistentClass:Class<?>

the persistent class

identifier:Object

the ID of the object for which the locking failed

ObjectOptimisticLockingFailureExceptionback to summary
public ObjectOptimisticLockingFailureException(Class<?> persistentClass, Object identifier, Throwable cause)

Create a new ObjectOptimisticLockingFailureException for the given object, with the default "optimistic locking failed" message.

Parameters
persistentClass:Class<?>

the persistent class

identifier:Object

the ID of the object for which the locking failed

cause:Throwable

the source exception

ObjectOptimisticLockingFailureExceptionback to summary
public ObjectOptimisticLockingFailureException(Class<?> persistentClass, Object identifier, String msg, Throwable cause)

Create a new ObjectOptimisticLockingFailureException for the given object, with the given explicit message.

Parameters
persistentClass:Class<?>

the persistent class

identifier:Object

the ID of the object for which the locking failed

msg:String

the detail message

cause:Throwable

the source exception

ObjectOptimisticLockingFailureExceptionback to summary
public ObjectOptimisticLockingFailureException(String persistentClassName, Object identifier)

Create a new ObjectOptimisticLockingFailureException for the given object, with the default "optimistic locking failed" message.

Parameters
persistentClassName:String

the name of the persistent class

identifier:Object

the ID of the object for which the locking failed

ObjectOptimisticLockingFailureExceptionback to summary
public ObjectOptimisticLockingFailureException(String persistentClassName, Object identifier, Throwable cause)

Create a new ObjectOptimisticLockingFailureException for the given object, with the default "optimistic locking failed" message.

Parameters
persistentClassName:String

the name of the persistent class

identifier:Object

the ID of the object for which the locking failed

cause:Throwable

the source exception

ObjectOptimisticLockingFailureExceptionback to summary
public ObjectOptimisticLockingFailureException(String persistentClassName, Object identifier, String msg, Throwable cause)

Create a new ObjectOptimisticLockingFailureException for the given object, with the given explicit message.

Parameters
persistentClassName:String

the name of the persistent class

identifier:Object

the ID of the object for which the locking failed

msg:String

the detail message

cause:Throwable

the source exception

Method Detail

getIdentifierback to summary
public Object getIdentifier()

Return the identifier of the object for which the locking failed.

Annotations
@Nullable
getPersistentClassback to summary
public Class<?> getPersistentClass()

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

Annotations
@Nullable
getPersistentClassNameback to summary
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.

Annotations
@Nullable