org.springframework.orm
Class ObjectRetrievalFailureException

java.lang.Object
  extended byjava.lang.Throwable
      extended byjava.lang.Exception
          extended byjava.lang.RuntimeException
              extended byorg.springframework.core.NestedRuntimeException
                  extended byorg.springframework.dao.DataAccessException
                      extended byorg.springframework.dao.DataRetrievalFailureException
                          extended byorg.springframework.orm.ObjectRetrievalFailureException
All Implemented Interfaces:
Serializable
Direct Known Subclasses:
HibernateObjectRetrievalFailureException, JdoObjectRetrievalFailureException

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

Field Summary
 
Fields inherited from class java.lang.RuntimeException
 
Constructor Summary
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 ex)
          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 ex)
          Create a new ObjectRetrievalFailureException for the given object, with the given explicit message and exception.
 
Method Summary
 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.
 
Methods inherited from class org.springframework.core.NestedRuntimeException
contains, getCause, getMessage, printStackTrace, printStackTrace
 
Methods inherited from class java.lang.Throwable
fillInStackTrace, getLocalizedMessage, getStackTrace, initCause, 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(Class persistentClass,
                                       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(Class persistentClass,
                                       Object identifier,
                                       String msg,
                                       Throwable ex)
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 - exception message
ex - source exception

ObjectRetrievalFailureException

public ObjectRetrievalFailureException(String persistentClassName,
                                       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(String persistentClassName,
                                       Object identifier,
                                       String msg,
                                       Throwable ex)
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 - exception message
ex - source exception
Method Detail

getPersistentClass

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


getPersistentClassName

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

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



Copyright (C) 2003-2004 The Spring Framework Project.