Package org.hibernate
Class WrongClassException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- javax.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, Serializable identifier, String entityName)
Constructs a WrongClassException using the supplied information.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getEntityName()
Serializable
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, Serializable identifier, String entityName)
Constructs a WrongClassException using the supplied information.- Parameters:
message
- A message explaining the exception conditionidentifier
- The identifier of the entityentityName
- The entity-type requested
-
-
Method Detail
-
getEntityName
public String getEntityName()
-
getIdentifier
public Serializable getIdentifier()
-
-