Package org.hibernate
Class UnresolvableObjectException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- javax.persistence.PersistenceException
-
- org.hibernate.HibernateException
-
- org.hibernate.UnresolvableObjectException
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
ObjectDeletedException
,ObjectNotFoundException
public class UnresolvableObjectException extends HibernateException
Thrown when Hibernate could not resolve an object by id, especially when loading an association.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description UnresolvableObjectException(Serializable identifier, String entityName)
Constructs an UnresolvableObjectException using the specified information.protected
UnresolvableObjectException(String message, Serializable identifier, String clazz)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getEntityName()
Serializable
getIdentifier()
String
getMessage()
static void
throwIfNull(Object entity, Serializable identifier, String entityName)
Factory method for building and throwing an UnresolvableObjectException if the entity is null.-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Constructor Detail
-
UnresolvableObjectException
public UnresolvableObjectException(Serializable identifier, String entityName)
Constructs an UnresolvableObjectException using the specified information.- Parameters:
identifier
- The identifier of the entity which could not be resolvedentityName
- The name of the entity which could not be resolved
-
UnresolvableObjectException
protected UnresolvableObjectException(String message, Serializable identifier, String clazz)
-
-
Method Detail
-
throwIfNull
public static void throwIfNull(Object entity, Serializable identifier, String entityName) throws UnresolvableObjectException
Factory method for building and throwing an UnresolvableObjectException if the entity is null.- Parameters:
entity
- The entity to check for nullnessidentifier
- The identifier of the entityentityName
- The name of the entity- Throws:
UnresolvableObjectException
- Thrown if entity is null
-
getIdentifier
public Serializable getIdentifier()
-
getEntityName
public String getEntityName()
-
getMessage
public String getMessage()
- Overrides:
getMessage
in classThrowable
-
-