diff --git a/integration-tests/hibernate-orm-panache/src/main/java/io/quarkus/it/panache/TestEndpoint.java b/integration-tests/hibernate-orm-panache/src/main/java/io/quarkus/it/panache/TestEndpoint.java index 2641e034de2b3..4fa6d1385947f 100644 --- a/integration-tests/hibernate-orm-panache/src/main/java/io/quarkus/it/panache/TestEndpoint.java +++ b/integration-tests/hibernate-orm-panache/src/main/java/io/quarkus/it/panache/TestEndpoint.java @@ -1253,6 +1253,18 @@ public String testProjection() { long countDistinct = projectionDistinctQuery.count(); Assertions.assertEquals(1L, countDistinct); + // We are checking that not everything gets lowercased + PanacheQuery letterCaseQuery = Cat + // The spaces at the beginning are intentional + .find(" SELECT disTINct 'GARFIELD', 'JoN ArBuCkLe' from Cat c where name = :NamE group by name ", + Parameters.with("NamE", bubulle.name), Sort.by("name")) + .project(CatProjectionBean.class); + + CatProjectionBean catView = letterCaseQuery.firstResult(); + // Must keep the letter case + Assertions.assertEquals(catView.getName(), "GARFIELD"); + Assertions.assertEquals(catView.getOwnerName(), "JoN ArBuCkLe"); + Cat.deleteAll(); CatOwner.deleteAll(); diff --git a/integration-tests/hibernate-reactive-panache/src/main/java/io/quarkus/it/panache/reactive/TestEndpoint.java b/integration-tests/hibernate-reactive-panache/src/main/java/io/quarkus/it/panache/reactive/TestEndpoint.java index fb50b9a4287b4..cdf977b09d7b2 100644 --- a/integration-tests/hibernate-reactive-panache/src/main/java/io/quarkus/it/panache/reactive/TestEndpoint.java +++ b/integration-tests/hibernate-reactive-panache/src/main/java/io/quarkus/it/panache/reactive/TestEndpoint.java @@ -1675,6 +1675,15 @@ public Uni testProjection2() { Assertions.assertTrue( exception.getMessage().startsWith("Unable to perform a projection on a 'select new' query")); }) + .invoke(() -> Cat + .find(" SELECT disTINct 'GARFIELD', 'JoN ArBuCkLe' from Cat c where name = :NamE group by name ", Parameters.with("NamE", catName), Sort.by("name")) + .project(CatProjectionBean.class)) + .chain(projectionQuery -> projectionQuery. firstResult()) + .invoke(catView -> { + // Must keep the letter case + Assertions.assertEquals(catView.name, "GARFIELD"); + Assertions.assertEquals(catView.ownerName, "JoN ArBuCkLe"); + }) .replaceWith("OK"); }