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
Thrown when Hibernate could not resolve an object by id, especially when
loading an association.
- See Also:
-
Constructor Summary
ModifierConstructorDescriptionUnresolvableObjectException
(Object identifier, String entityName) Constructs anUnresolvableObjectException
using the specified information.protected
UnresolvableObjectException
(String message, Object identifier, String clazz) -
Method Summary
Modifier and TypeMethodDescriptionstatic 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 Details
-
UnresolvableObjectException
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
-
UnresolvableObjectException
-
-
Method Details
-
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
-
getEntityName
-
getMessage
- Overrides:
getMessage
in classThrowable
-