From 6ef07bfd15ea58654d1b28ebd593314f71d4fb01 Mon Sep 17 00:00:00 2001 From: marko-bekhta Date: Thu, 8 Aug 2024 22:06:57 +0200 Subject: [PATCH] WIP --- .../it/panache/defaultpu/TestEndpoint.java | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/integration-tests/hibernate-orm-panache/src/main/java/io/quarkus/it/panache/defaultpu/TestEndpoint.java b/integration-tests/hibernate-orm-panache/src/main/java/io/quarkus/it/panache/defaultpu/TestEndpoint.java index 07b56adcd78985..624d86daa926e5 100644 --- a/integration-tests/hibernate-orm-panache/src/main/java/io/quarkus/it/panache/defaultpu/TestEndpoint.java +++ b/integration-tests/hibernate-orm-panache/src/main/java/io/quarkus/it/panache/defaultpu/TestEndpoint.java @@ -1860,4 +1860,27 @@ public String testBug31117() { Assertions.assertEquals(1, Person.delete("\r\n \n\ndelete\nfrom\n Person2\nwhere\nname = ?1", "foo")); return "OK"; } + + @GET + @Path("42416") + @Transactional + public String testBug42416() { + Person.deleteAll(); + Person p = new Person(); + p.name = "stef"; + p.persist(); + + Person p2 = new Person(); + p2.name = "stef"; + p2.persist(); + + try { + Person found = Person.find("where name = ?1", "stef").singleResult(); + } catch (jakarta.persistence.NonUniqueResultException e) { + return "OK"; + } catch (org.hibernate.NonUniqueResultException e) { + e.printStackTrace(); + return "KO"; + } + } }