Package org.hibernate

Class NonUniqueObjectException

  • All Implemented Interfaces:
    java.io.Serializable

    public class NonUniqueObjectException
    extends HibernateException
    This exception is thrown when an operation would break session-scoped identity. This occurs if the user tries to associate two different instances of the same Java class with a particular identifier, in the scope of a single Session.
    See Also:
    Serialized Form
    • Constructor Summary

      Constructors 
      Constructor Description
      NonUniqueObjectException​(java.io.Serializable entityId, java.lang.String entityName)
      Constructs a NonUniqueObjectException using the given information, using a standard message.
      NonUniqueObjectException​(java.lang.String message, java.io.Serializable entityId, java.lang.String entityName)
      Constructs a NonUniqueObjectException using the given information.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String getEntityName()  
      java.io.Serializable getIdentifier()  
      java.lang.String getMessage()  
      • Methods inherited from class java.lang.Throwable

        addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • NonUniqueObjectException

        public NonUniqueObjectException​(java.lang.String message,
                                        java.io.Serializable entityId,
                                        java.lang.String entityName)
        Constructs a NonUniqueObjectException using the given information.
        Parameters:
        message - A message explaining the exception condition
        entityId - The identifier of the entity
        entityName - The name of the entity
      • NonUniqueObjectException

        public NonUniqueObjectException​(java.io.Serializable entityId,
                                        java.lang.String entityName)
        Constructs a NonUniqueObjectException using the given information, using a standard message.
        Parameters:
        entityId - The identifier of the entity
        entityName - The name of the entity
    • Method Detail

      • getEntityName

        public java.lang.String getEntityName()
      • getIdentifier

        public java.io.Serializable getIdentifier()
      • getMessage

        public java.lang.String getMessage()
        Overrides:
        getMessage in class java.lang.Throwable