From db4c3b55fec9fcee4006b5e93848853d1fbc8b06 Mon Sep 17 00:00:00 2001 From: Davide D'Alto Date: Thu, 23 Nov 2023 13:25:12 +0100 Subject: [PATCH] [#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 --- .../src/main/java/org/hibernate/reactive/logging/impl/Log.java | 3 +++ 1 file changed, 3 insertions(+) diff --git a/hibernate-reactive-core/src/main/java/org/hibernate/reactive/logging/impl/Log.java b/hibernate-reactive-core/src/main/java/org/hibernate/reactive/logging/impl/Log.java index 1d1324652..72760a26b 100644 --- a/hibernate-reactive-core/src/main/java/org/hibernate/reactive/logging/impl/Log.java +++ b/hibernate-reactive-core/src/main/java/org/hibernate/reactive/logging/impl/Log.java @@ -255,6 +255,9 @@ public interface Log extends BasicLogger { @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") HibernateException blankConnectionString(String property); + @Message(id = 80, value = "No results were returned by the query (you can try running it with '.executeUpdate()'): %1$s") + HibernateException noResultException(String sql); + // Same method that exists in CoreMessageLogger @LogMessage(level = WARN) @Message(id = 104, value = "firstResult/maxResults specified with collection fetch; applying in memory!" )