[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-6695) Error "Cannot create TypedQuery for query with more than one return" with named queries

Oliver Siegmar (JIRA) noreply at atlassian.com
Fri Jan 13 02:43:10 EST 2012


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-6695?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=45123#comment-45123 ] 

Oliver Siegmar commented on HHH-6695:
-------------------------------------

As this ticket is now marked as duplicate, I hope all voters will vote/watch now for HHH-6304.

> Error "Cannot create TypedQuery for query with more than one return" with named queries
> ---------------------------------------------------------------------------------------
>
>                 Key: HHH-6695
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6695
>             Project: Hibernate ORM
>          Issue Type: Bug
>          Components: entity-manager
>    Affects Versions: 3.6.7, 4.0.0.CR4, 3.6.8
>            Reporter: Oliver Siegmar
>            Assignee: Gail Badner
>
> The already closed issues HHH-5348 and HHH-6591 only fixed the bug with standard (non-named) queries. Having a query like {code:sql}SELECT NEW org.test.MyClass( 'Foo', 123 ) FROM IrcEvent ev{code} as shown in HHH-6591 used by createQuery(), the bug has been fixed. Using the very same query as a named query by createNamedQuery() this exception is thrown:
> {noformat}
> java.lang.IllegalArgumentException: Cannot create TypedQuery for query with more than one return
>         at org.hibernate.ejb.AbstractEntityManagerImpl.createNamedQuery(AbstractEntityManagerImpl.java:684) ~[hibernate-entitymanager-4.0.0-20110929.060732-144.jar:4.0.0-SNAPSHOT]
>         at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[na:1.7.0]
>         at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) ~[na:1.7.0]
>         at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[na:1.7.0]
> ...
> {noformat}

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list