Package org.hibernate

Class 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:
  • Constructor Details

    • UnresolvableObjectException

      public UnresolvableObjectException(Object identifier, String entityName)
      Constructs an UnresolvableObjectException using the specified information.
      Parameters:
      identifier - The identifier of the entity which could not be resolved
      entityName - The name of the entity which could not be resolved
    • UnresolvableObjectException

      protected UnresolvableObjectException(String message, Object identifier, String clazz)
  • Method Details

    • throwIfNull

      public static void throwIfNull(Object entity, Object identifier, String entityName) throws UnresolvableObjectException
      Factory method for building and throwing an UnresolvableObjectException if the entity is null.
      Parameters:
      entity - The entity to check for nullness
      identifier - The identifier of the entity
      entityName - 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 class Throwable