类 ObjectOptimisticLockingFailureException
- java.lang.Object
- java.lang.Throwable
- java.lang.Exception
- java.lang.RuntimeException
- org.springframework.core.NestedRuntimeException
- org.springframework.dao.DataAccessException
- org.springframework.dao.TransientDataAccessException
- org.springframework.dao.ConcurrencyFailureException
- org.springframework.dao.OptimisticLockingFailureException
- org.springframework.orm.ObjectOptimisticLockingFailureException
- 所有已实现的接口:
Serializable
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.- 从以下版本开始:
- 13.10.2003
- 作者:
- Juergen Hoeller
- 另请参阅:
- 序列化表格
构造器概要
构造器 构造器 说明 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 cause)
Create a new ObjectOptimisticLockingFailureException for the given object, with the given explicit message.ObjectOptimisticLockingFailureException(Class<?> persistentClass, Object identifier, Throwable cause)
Create a new ObjectOptimisticLockingFailureException for the given object, with the default "optimistic locking failed" 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 cause)
Create a new ObjectOptimisticLockingFailureException for the given object, with the given explicit message.ObjectOptimisticLockingFailureException(String persistentClassName, Object identifier, Throwable cause)
Create a new ObjectOptimisticLockingFailureException for the given object, with the default "optimistic locking failed" message.ObjectOptimisticLockingFailureException(String msg, Throwable cause)
Create a general ObjectOptimisticLockingFailureException with the given message, without any information on the affected object.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 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.从类继承的方法 org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
构造器详细资料
ObjectOptimisticLockingFailureException
public ObjectOptimisticLockingFailureException(String msg, Throwable cause)
Create a general ObjectOptimisticLockingFailureException with the given message, without any information on the affected object.- 参数:
msg
- the detail messagecause
- 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.- 参数:
persistentClass
- the persistent classidentifier
- 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.- 参数:
persistentClass
- the persistent classidentifier
- the ID of the object for which the locking failedcause
- the source exception
ObjectOptimisticLockingFailureException
public ObjectOptimisticLockingFailureException(Class<?> persistentClass, Object identifier, String msg, @Nullable Throwable cause)
Create a new ObjectOptimisticLockingFailureException for the given object, with the given explicit message.- 参数:
persistentClass
- the persistent classidentifier
- the ID of the object for which the locking failedmsg
- the detail messagecause
- 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.- 参数:
persistentClassName
- the name of the persistent classidentifier
- 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.- 参数:
persistentClassName
- the name of the persistent classidentifier
- the ID of the object for which the locking failedcause
- the source exception
ObjectOptimisticLockingFailureException
public ObjectOptimisticLockingFailureException(String persistentClassName, Object identifier, String msg, @Nullable Throwable cause)
Create a new ObjectOptimisticLockingFailureException for the given object, with the given explicit message.- 参数:
persistentClassName
- the name of the persistent classidentifier
- the ID of the object for which the locking failedmsg
- the detail messagecause
- the source exception
方法详细资料
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.