HHH-13300 Correctly convert Hibernate exceptions to JPA in getSingleResult()
This commit is contained in:
parent
53f70ab213
commit
4665fd9cd9
|
@ -1581,13 +1581,8 @@ 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;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static <R> R uniqueElement(List<R> list) throws NonUniqueResultException {
|
public static <R> R uniqueElement(List<R> list) throws NonUniqueResultException {
|
||||||
|
|
Loading…
Reference in New Issue