You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running a native query that doesn't return any result (for example,
the creation of a stored procedure), `io.vertx.sqlclient.SqlResult#columnsNames` will be null.
This commit doesn two things:
1. add null check to avoid a NPE if `.columnsNames` returns null;
2. Throw an HibernateException if the user call getSingleResultOrNull
but the query doesn't return any result.
Note that we could return null in this situation, but we've decided
to be consistent with Hibernate ORM, where the JDBC driver will throw
the following exception (with PostgreSQL at least):
```
Caused by: org.postgresql.util.PSQLException: No results were returned by the query.
at org.postgresql.jdbc.PgPreparedStatement.executeQuery(PgPreparedStatement.java:135)
at org.hibernate.sql.results.jdbc.internal.DeferredResultSetAccess.executeQuery(DeferredResultSetAccess.java:240)
```
Copy file name to clipboardExpand all lines: hibernate-reactive-core/src/main/java/org/hibernate/reactive/sql/results/internal/ReactiveDeferredResultSetAccess.java
0 commit comments