Package org.hibernate
Class UnresolvableObjectException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- jakarta.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(Object identifier, String entityName)
Constructs anUnresolvableObjectException
using the specified information.protected
UnresolvableObjectException(String message, Object identifier, String clazz)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getEntityName()
Object
getIdentifier()
String
getMessage()
static void
throwIfNull(Object entity, Object identifier, String entityName)
Factory method for building and throwing anUnresolvableObjectException
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(Object identifier, String entityName)
Constructs anUnresolvableObjectException
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
-
-
Method Detail
-
throwIfNull
public static void throwIfNull(Object entity, Object identifier, String entityName) throws UnresolvableObjectException
Factory method for building and throwing anUnresolvableObjectException
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 Object getIdentifier()
-
getEntityName
public String getEntityName()
-
getMessage
public String getMessage()
- Overrides:
getMessage
in classThrowable
-
-