类 ObjectRetrievalFailureException
- 所有已实现的接口:
Serializable
public class ObjectRetrievalFailureException extends DataRetrievalFailureException
Exception thrown if a mapped object could not be retrieved via its identifier. Provides information about the persistent class and the identifier.- 从以下版本开始:
- 13.10.2003
- 作者:
- Juergen Hoeller
- 另请参阅:
- 序列化表格
构造器概要
构造器 构造器 说明 ObjectRetrievalFailureException(Class<?> persistentClass, Object identifier)
Create a new ObjectRetrievalFailureException for the given object, with the default "not found" message.ObjectRetrievalFailureException(Class<?> persistentClass, Object identifier, String msg, Throwable cause)
Create a new ObjectRetrievalFailureException for the given object, with the given explicit message and exception.ObjectRetrievalFailureException(String persistentClassName, Object identifier)
Create a new ObjectRetrievalFailureException for the given object, with the default "not found" message.ObjectRetrievalFailureException(String persistentClassName, Object identifier, String msg, Throwable cause)
Create a new ObjectRetrievalFailureException for the given object, with the given explicit message and exception.ObjectRetrievalFailureException(String msg, Throwable cause)
Create a general ObjectRetrievalFailureException with the given message, without any information on the affected object.
方法概要
所有方法 实例方法 具体方法 修饰符和类型 方法 说明 Object
getIdentifier()
Return the identifier of the object that was not found.Class<?>
getPersistentClass()
Return the persistent class of the object that was not found.String
getPersistentClassName()
Return the name of the persistent class of the object that was not found.从类继承的方法 org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
构造器详细资料
ObjectRetrievalFailureException
public ObjectRetrievalFailureException(String msg, Throwable cause)
Create a general ObjectRetrievalFailureException with the given message, without any information on the affected object.- 参数:
msg
- the detail messagecause
- the source exception
ObjectRetrievalFailureException
public ObjectRetrievalFailureException(Class<?> persistentClass, Object identifier)
Create a new ObjectRetrievalFailureException for the given object, with the default "not found" message.- 参数:
persistentClass
- the persistent classidentifier
- the ID of the object that should have been retrieved
ObjectRetrievalFailureException
public ObjectRetrievalFailureException(Class<?> persistentClass, Object identifier, String msg, @Nullable Throwable cause)
Create a new ObjectRetrievalFailureException for the given object, with the given explicit message and exception.- 参数:
persistentClass
- the persistent classidentifier
- the ID of the object that should have been retrievedmsg
- the detail messagecause
- the source exception
ObjectRetrievalFailureException
public ObjectRetrievalFailureException(String persistentClassName, Object identifier)
Create a new ObjectRetrievalFailureException for the given object, with the default "not found" message.- 参数:
persistentClassName
- the name of the persistent classidentifier
- the ID of the object that should have been retrieved
ObjectRetrievalFailureException
public ObjectRetrievalFailureException(String persistentClassName, Object identifier, String msg, @Nullable Throwable cause)
Create a new ObjectRetrievalFailureException for the given object, with the given explicit message and exception.- 参数:
persistentClassName
- the name of the persistent classidentifier
- the ID of the object that should have been retrievedmsg
- the detail messagecause
- the source exception
方法详细资料
getPersistentClass
@Nullable public Class<?> getPersistentClass()
Return the persistent class of the object that was not found. If no Class was specified, this method returns null.
getPersistentClassName
@Nullable public String getPersistentClassName()
Return the name of the persistent class of the object that was not found. Will work for both Class objects and String names.
getIdentifier
@Nullable public Object getIdentifier()
Return the identifier of the object that was not found.