Package org.hibernate

Class WrongClassException

  • All Implemented Interfaces:

    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 Detail

      • WrongClassException

        public WrongClassException​(String message,
                                   Object identifier,
                                   String entityName)
        Constructs a WrongClassException using the supplied information.
        message - A message explaining the exception condition
        identifier - The identifier of the entity
        entityName - The entity-type requested
      • WrongClassException

        public WrongClassException​(String resolvedEntityName,
                                   Object identifier,
                                   String expectedEntityName,
                                   Object discriminatorValue)
    • Method Detail

      • getEntityName

        public String getEntityName()
      • getIdentifier

        public Object getIdentifier()