Package org.hibernate
Class WrongClassException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- jakarta.persistence.PersistenceException
-
- org.hibernate.HibernateException
-
- org.hibernate.WrongClassException
-
- All Implemented Interfaces:
Serializable
public class WrongClassException extends HibernateException
Thrown when loading an entity (by identifier) results in a value that cannot be treated as the subclass type requested by the caller.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description WrongClassException(String message, Object identifier, String entityName)
Constructs aWrongClassException
using the supplied information.WrongClassException(String resolvedEntityName, Object identifier, String expectedEntityName, Object discriminatorValue)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getEntityName()
Object
getIdentifier()
-
Methods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
-
-
-
Constructor Detail
-
WrongClassException
public WrongClassException(String message, Object identifier, String entityName)
Constructs aWrongClassException
using the supplied information.- Parameters:
message
- A message explaining the exception conditionidentifier
- The identifier of the entityentityName
- The entity-type requested
-
-