Panache projection handles primitive type incorrectly #43368
Labels
area/hibernate-orm
Hibernate ORM
kind/bug-thirdparty
Bugs that are caused by third-party components and not causing a major dysfunction of core Quarkus.
kind/enhancement
New feature or request
Describe the bug
I have a POJO with a constructor of some fields (some are objects like a String, others are primitive types like boolean or short).
If I do a "select new MyPojo(...)" query, it works fine and the POJO is created as expected.
But when using the #project(..) method from PanacheQuery, I get an error for a missing constructor. Only if I change the constructor of the POJO to have no primitive types but the object types (long->Long, boolean->Boolean) this works again.
Expected behavior
The Panache projection should also work with primitive types.
Actual behavior
No response
How to Reproduce?
Working:
((Session) MyEntity.getEntityManager()).createQuery("select new MyPojo(attribString, attribBoolean) from MY_ENTITY).list();
Not working:
MyEntity.find(select attribString, attribBoolean) from MY_ENTITY).project(MyPojo.class).list()
Output of
uname -a
orver
No response
Output of
java -version
21
Quarkus version or git rev
3.14.4
Build tool (ie. output of
mvnw --version
orgradlew --version
)mvn
Additional information
No response
The text was updated successfully, but these errors were encountered: