Package org.hibernate
Class NonUniqueObjectException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- javax.persistence.PersistenceException
-
- org.hibernate.HibernateException
-
- org.hibernate.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()
-
-
-
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 conditionentityId
- The identifier of the entityentityName
- 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 entityentityName
- The name of the entity
-
-