Error "Cannot create TypedQuery for query with more than one return" with named queries

Description

Constructor queries (SELECT NEW xyz(a,b)...) with more than one parameter in the constructor are resulting in an java.lang.IllegalArgumentException: Cannot create TypedQuery for query with more than one return.

Code snippet for testing:
List<ListResult> resultList = em.createQuery("SELECT NEW domain.results.ListResult(p.name, p.adress) FROM Person p", ListResult.class).getResultList();

Moreover queries with one paramater in ctor result in an
java.lang.IllegalArgumentException: Type specified for TypedQuery [com.evva.keyxs.backend.domain.results.ListResult] is incompatible with query return type [class java.lang.String]
at org.hibernate.ejb.AbstractEntityManagerImpl.createQuery(AbstractEntityManagerImpl.java:286)

More on this in HHH-5348. Its not fixed yet.
http://opensource.atlassian.com/projects/hibernate/browse/HHH-5348

is a fix for

    Failed to load remote issue because remote site is not linked

Activity

Strong LiuJuly 12, 2012 at 5:35 AM

https://hibernate.atlassian.net/browse/HHH-6695#icft=HHH-6695 says namedQuery, I'm not sure how this is duplicated with that, plus I think this is resolved by HHH-5348, isn't it?

Strong LiuJuly 11, 2012 at 11:07 AM

Steve,

is this issue going to be fixed in 4.1.5? I'm going to release it in my tomorrow morning, so if it is not, please move it, thanks

Ronak PatelJuly 5, 2012 at 2:55 PM

I'm surprised this bug is never addressed; whilst so many other ones are...

Ondra ŽižkaFebruary 27, 2012 at 1:38 PM
Edited

.

Hans DesmetJanuary 13, 2012 at 10:05 AM

Bug is also in 4.0.1

Fixed

Details

Assignee

Reporter

Fix versions

Priority

Created June 9, 2011 at 2:11 PM
Updated December 11, 2012 at 10:12 PM
Resolved July 12, 2012 at 5:54 AM

Flag notifications