Skip to content

Commit db4c3b5

Browse files
committed
[#1792] Add new HibernateException for when there are no results
It should get thrown when a user call `.getSingleResultOrNull()` but the SQL query doesn't return any result. For example, when creating a stored procedure in PosgtreSQL
1 parent 4e6bc8d commit db4c3b5

File tree

1 file changed

+3
-0
lines changed
  • hibernate-reactive-core/src/main/java/org/hibernate/reactive/logging/impl

1 file changed

+3
-0
lines changed

hibernate-reactive-core/src/main/java/org/hibernate/reactive/logging/impl/Log.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -255,6 +255,9 @@ public interface Log extends BasicLogger {
255255
@Message(id = 79, value = "The configuration property '%1$s' was not provided, or is in invalid format. This is required when using the default DefaultSqlClientPool: either provide the configuration setting or integrate with a different SqlClientPool implementation")
256256
HibernateException blankConnectionString(String property);
257257

258+
@Message(id = 80, value = "No results were returned by the query (you can try running it with '.executeUpdate()'): %1$s")
259+
HibernateException noResultException(String sql);
260+
258261
// Same method that exists in CoreMessageLogger
259262
@LogMessage(level = WARN)
260263
@Message(id = 104, value = "firstResult/maxResults specified with collection fetch; applying in memory!" )

0 commit comments

Comments
 (0)