HHH-6697 Fixed conversion of Hibernate exceptions to JPA exceptions.
This commit is contained in:
parent
3bd95da6c5
commit
e69b37a9a4
|
@ -26,6 +26,7 @@ package org.hibernate.ejb;
|
|||
|
||||
import javax.persistence.CacheRetrieveMode;
|
||||
import javax.persistence.CacheStoreMode;
|
||||
import javax.persistence.EntityExistsException;
|
||||
import javax.persistence.EntityManager;
|
||||
import javax.persistence.EntityNotFoundException;
|
||||
import javax.persistence.EntityTransaction;
|
||||
|
@ -1354,6 +1355,11 @@ public abstract class AbstractEntityManagerImpl implements HibernateEntityManage
|
|||
handlePersistenceException( converted );
|
||||
return converted;
|
||||
}
|
||||
else if ( e instanceof org.hibernate.NonUniqueObjectException ) {
|
||||
EntityExistsException converted = new EntityExistsException( e.getMessage() );
|
||||
handlePersistenceException( converted );
|
||||
return converted;
|
||||
}
|
||||
else if ( e instanceof org.hibernate.NonUniqueResultException ) {
|
||||
NonUniqueResultException converted = new NonUniqueResultException( e.getMessage() );
|
||||
handlePersistenceException( converted );
|
||||
|
|
Loading…
Reference in New Issue