[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-6591) JPA QL's NEW MyClass(...) construct fails - number of constructor params used during validation
Jordan Marinov (JIRA)
noreply at atlassian.com
Sun Aug 21 23:55:02 EDT 2011
[ http://opensource.atlassian.com/projects/hibernate/browse/HHH-6591?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=43314#comment-43314 ]
Jordan Marinov commented on HHH-6591:
-------------------------------------
Happens in 3.6.7.
Using regular Query and suppressing the type check seems to be a feasible workaround.
> JPA QL's NEW MyClass(...) construct fails - number of constructor params used during validation
> -----------------------------------------------------------------------------------------------
>
> Key: HHH-6591
> URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-6591
> Project: Hibernate Core
> Issue Type: Bug
> Components: entity-manager
> Affects Versions: 3.6.4, 3.6.5, 3.6.6
> Reporter: Ondrej Zizka
> Priority: Critical
>
> This
> {code}
> List<MyClass> list = em.createQuery("SELECT NEW org.test.MyClass( 'Foo', 123 ) FROM IrcEvent ev", MyClass.class).getResultList();
> {code}
> and this
> {code}
> List<Object[]> list = em.createQuery("SELECT 'Foo', 123 FROM IrcEvent ev", Object[].class).getResultList();
> {code}
> ends up with:
> {quote}
> java.lang.IllegalArgumentException: Cannot create TypedQuery for query with more than one return
> {quote}
> Both should work according to docs.
> This has been reported and worked on as per HHH-5348, but the issue prevails.
--
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