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

Oliver Siegmar (JIRA) noreply at atlassian.com
Thu Sep 29 13:14:28 EDT 2011


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 Core
          Issue Type: Bug
          Components: entity-manager
    Affects Versions: 4.0.0.CR4, 3.6.7, 3.6.8
            Reporter: Oliver Siegmar


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