Package org.hibernate
Class NonUniqueObjectException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
jakarta.persistence.PersistenceException
org.hibernate.HibernateException
org.hibernate.NonUniqueObjectException
- All Implemented Interfaces:
Serializable
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:
-
Constructor Summary
ConstructorDescriptionNonUniqueObjectException
(Object entityId, String entityName) Constructs aNonUniqueObjectException
using the given information, and using a standard message.NonUniqueObjectException
(String message, Object entityId, String entityName) Constructs aNonUniqueObjectException
using the given information. -
Method Summary
Modifier and TypeMethodDescriptionMethods inherited from class java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString
-
Constructor Details
-
NonUniqueObjectException
Constructs aNonUniqueObjectException
using the given information.- Parameters:
message
- A message explaining the exception conditionentityId
- The identifier of the entityentityName
- The name of the entity
-
NonUniqueObjectException
Constructs aNonUniqueObjectException
using the given information, and using a standard message.- Parameters:
entityId
- The identifier of the entityentityName
- The name of the entity
-
-
Method Details
-
getEntityName
-
getIdentifier
-
getMessage
- Overrides:
getMessage
in classThrowable
-