From 90a5943ee841f9ff04fa46bc6390c780e70b9b62 Mon Sep 17 00:00:00 2001 From: humberto Date: Sat, 18 Nov 2023 00:04:49 +0100 Subject: [PATCH] #36581 tested with JDK 11, no issue :( + remove System.out committed by mistake. --- .../orm/panache/common/runtime/CommonPanacheQueryImpl.java | 4 +--- .../panache/common/runtime/CommonPanacheQueryImpl.java | 4 +--- .../quarkus/it/panache/reactive/PanacheFunctionalityTest.java | 1 + 3 files changed, 3 insertions(+), 6 deletions(-) diff --git a/extensions/panache/hibernate-orm-panache-common/runtime/src/main/java/io/quarkus/hibernate/orm/panache/common/runtime/CommonPanacheQueryImpl.java b/extensions/panache/hibernate-orm-panache-common/runtime/src/main/java/io/quarkus/hibernate/orm/panache/common/runtime/CommonPanacheQueryImpl.java index 6643f64e5a6b4..e316768572f1f 100644 --- a/extensions/panache/hibernate-orm-panache-common/runtime/src/main/java/io/quarkus/hibernate/orm/panache/common/runtime/CommonPanacheQueryImpl.java +++ b/extensions/panache/hibernate-orm-panache-common/runtime/src/main/java/io/quarkus/hibernate/orm/panache/common/runtime/CommonPanacheQueryImpl.java @@ -122,9 +122,7 @@ public CommonPanacheQueryImpl project(Class type) { } // build select clause with a constructor expression - StringBuilder selectClause = new StringBuilder("SELECT "); - selectClause.append(getParameterFromClass(type, null)); - System.out.println(selectClause); + String selectClause = "SELECT " + getParameterFromClass(type, null); return new CommonPanacheQueryImpl<>(this, selectClause + selectQuery, "select count(*) " + selectQuery); } diff --git a/extensions/panache/hibernate-reactive-panache-common/runtime/src/main/java/io/quarkus/hibernate/reactive/panache/common/runtime/CommonPanacheQueryImpl.java b/extensions/panache/hibernate-reactive-panache-common/runtime/src/main/java/io/quarkus/hibernate/reactive/panache/common/runtime/CommonPanacheQueryImpl.java index 7ececab540d91..0f6e5dbdced0d 100644 --- a/extensions/panache/hibernate-reactive-panache-common/runtime/src/main/java/io/quarkus/hibernate/reactive/panache/common/runtime/CommonPanacheQueryImpl.java +++ b/extensions/panache/hibernate-reactive-panache-common/runtime/src/main/java/io/quarkus/hibernate/reactive/panache/common/runtime/CommonPanacheQueryImpl.java @@ -112,9 +112,7 @@ public CommonPanacheQueryImpl project(Class type) { } // build select clause with a constructor expression - StringBuilder selectClause = new StringBuilder("SELECT "); - selectClause.append(getParameterFromClass(type, null)); - System.out.println(selectClause); + String selectClause = "SELECT " + getParameterFromClass(type, null); return new CommonPanacheQueryImpl<>(this, selectClause + selectQuery, "select count(*) " + selectQuery); } diff --git a/integration-tests/hibernate-reactive-panache/src/test/java/io/quarkus/it/panache/reactive/PanacheFunctionalityTest.java b/integration-tests/hibernate-reactive-panache/src/test/java/io/quarkus/it/panache/reactive/PanacheFunctionalityTest.java index c3bbc1e142edc..ad085c0e79988 100644 --- a/integration-tests/hibernate-reactive-panache/src/test/java/io/quarkus/it/panache/reactive/PanacheFunctionalityTest.java +++ b/integration-tests/hibernate-reactive-panache/src/test/java/io/quarkus/it/panache/reactive/PanacheFunctionalityTest.java @@ -364,6 +364,7 @@ void testDogDto2Projection(UniAsserter asserter) { .project(DogDto2.class) .firstResult(), dogDto2 -> { + Assertions.assertNotNull(dogDto2); Assertions.assertEquals("kit", dogDto2.name); Assertions.assertEquals("hum", dogDto2.owner.name); });