HHH-13300 Correctly convert Hibernate exceptions to JPA in getSingleResult()
(cherry picked from commit 4665fd9cd9
)
This commit is contained in:
parent
8d4c47bffc
commit
a3433be822
|
@ -1557,12 +1557,7 @@ public abstract class AbstractProducedQuery<R> implements QueryImplementor<R> {
|
||||||
return uniqueElement( list );
|
return uniqueElement( list );
|
||||||
}
|
}
|
||||||
catch ( HibernateException e ) {
|
catch ( HibernateException e ) {
|
||||||
if ( getProducer().getFactory().getSessionFactoryOptions().isJpaBootstrap() ) {
|
throw getExceptionConverter().convert( e );
|
||||||
throw getExceptionConverter().convert( e );
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
throw e;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue