[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-5348) java.lang.IllegalArgumentException: Cannot create TypedQuery for query with more than one return with AbstractEntityManager.createQuery(String jpaqlString, Class<T> resultClass) on View object

Vladimir Klyushnikov (JIRA) noreply at atlassian.com
Tue Oct 26 07:49:49 EDT 2010


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

Vladimir Klyushnikov commented on HHH-5348:
-------------------------------------------

Bug is still in 3.6.0.Final. I've just encountered it and this is terrible. Forced to use untyped version of EntityManager.createQuery. So this functionality does not work according to JPA 2.0 spec.  

> java.lang.IllegalArgumentException: Cannot create TypedQuery for query with more than one return with AbstractEntityManager.createQuery(String jpaqlString, Class<T> resultClass) on View object
> ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: HHH-5348
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-5348
>             Project: Hibernate Core
>          Issue Type: Bug
>          Components: entity-manager
>    Affects Versions: 3.5.3
>            Reporter: nodje
>         Attachments: ItemNameDescription.java
>
>
> I'm getting a
> java.lang.IllegalArgumentException: Cannot create TypedQuery for query with more than one return
> with a query that returns a View object.
> AbstractEntityManager:279, detects as many returns type as there is parameters in the View object, instead of one single result type, the View Object itself.
> QueryString example that fails with public <T> TypedQuery<T> createQuery(String jpaqlString, Class<T> resultClass):
> "select new WorkContractDto(wc.workContractStartDate, wc.workContractEndDate, wc.workContractEmployeeLastName, wc.workContractSendingStatus) from WorkContract wc where wc.workContractEmployeeLastName = ?1"

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list