Spring Framework

org.springframework.orm
Class ObjectRetrievalFailureException

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.NonTransientDataAccessException
                          extended by org.springframework.dao.DataRetrievalFailureException
                              extended by org.springframework.orm.ObjectRetrievalFailureException
All Implemented Interfaces:
java.io.Serializable
Direct Known Subclasses:
HibernateObjectRetrievalFailureException, HibernateObjectRetrievalFailureException, JdoObjectRetrievalFailureException, JpaObjectRetrievalFailureException

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.

Since:
13.10.2003
Author:
Juergen Hoeller
See Also:
Serialized Form

Constructor Summary
ObjectRetrievalFailureException(java.lang.Class persistentClass, java.lang.Object identifier)
          Create a new ObjectRetrievalFailureException for the given object, with the default "not found" message.
ObjectRetrievalFailureException(java.lang.Class persistentClass, java.lang.Object identifier, java.lang.String msg, java.lang.Throwable cause)
          Create a new ObjectRetrievalFailureException for the given object, with the given explicit message and exception.
ObjectRetrievalFailureException(java.lang.String persistentClassName, java.lang.Object identifier)
          Create a new ObjectRetrievalFailureException for the given object, with the default "not found" message.
ObjectRetrievalFailureException(java.lang.String persistentClassName, java.lang.Object identifier, java.lang.String msg, java.lang.Throwable cause)
          Create a new ObjectRetrievalFailureException for the given object, with the given explicit message and exception.
ObjectRetrievalFailureException(java.lang.String msg, java.lang.Throwable cause)
          Create a general ObjectRetrievalFailureException with the given message, without any information on the affected object.
 
Method Summary
 java.lang.Object getIdentifier()
          Return the identifier of the object that was not found.
 java.lang.Class getPersistentClass()
          Return the persistent class of the object that was not found.
 java.lang.String getPersistentClassName()
          Return the name of the persistent class of the object that was not found.
 
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getMessage, getMostSpecificCause, getRootCause
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ObjectRetrievalFailureException

public ObjectRetrievalFailureException(java.lang.String msg,
                                       java.lang.Throwable cause)
Create a general ObjectRetrievalFailureException with the given message, without any information on the affected object.

Parameters:
msg - the detail message
cause - the source exception

ObjectRetrievalFailureException

public ObjectRetrievalFailureException(java.lang.Class persistentClass,
                                       java.lang.Object identifier)
Create a new ObjectRetrievalFailureException for the given object, with the default "not found" message.

Parameters:
persistentClass - the persistent class
identifier - the ID of the object that should have been retrieved

ObjectRetrievalFailureException

public ObjectRetrievalFailureException(java.lang.Class persistentClass,
                                       java.lang.Object identifier,
                                       java.lang.String msg,
                                       java.lang.Throwable cause)
Create a new ObjectRetrievalFailureException for the given object, with the given explicit message and exception.

Parameters:
persistentClass - the persistent class
identifier - the ID of the object that should have been retrieved
msg - the detail message
cause - the source exception

ObjectRetrievalFailureException

public ObjectRetrievalFailureException(java.lang.String persistentClassName,
                                       java.lang.Object identifier)
Create a new ObjectRetrievalFailureException for the given object, with the default "not found" message.

Parameters:
persistentClassName - the name of the persistent class
identifier - the ID of the object that should have been retrieved

ObjectRetrievalFailureException

public ObjectRetrievalFailureException(java.lang.String persistentClassName,
                                       java.lang.Object identifier,
                                       java.lang.String msg,
                                       java.lang.Throwable cause)
Create a new ObjectRetrievalFailureException for the given object, with the given explicit message and exception.

Parameters:
persistentClassName - the name of the persistent class
identifier - the ID of the object that should have been retrieved
msg - the detail message
cause - the source exception
Method Detail

getPersistentClass

public java.lang.Class getPersistentClass()
Return the persistent class of the object that was not found. If no Class was specified, this method returns null.


getPersistentClassName

public java.lang.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

public java.lang.Object getIdentifier()
Return the identifier of the object that was not found.


Spring Framework