You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Romain Manni-Bucau (JIRA)" <ji...@apache.org> on 2015/11/27 16:13:10 UTC
[jira] [Commented] (OPENJPA-2618) Query for Tuple does not return
Tuple instance
[ https://issues.apache.org/jira/browse/OPENJPA-2618?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15029962#comment-15029962 ]
Romain Manni-Bucau commented on OPENJPA-2618:
---------------------------------------------
Hi Olivier,
I didnt find why it should be supported outside criteria API:
{code}
The semantics of this method may be extended in a future release of this specification to support other result types. Applications
that specify other result types (e.g., Tuple.class) will not be portable.
{code}
annotates createQuery()
> Query for Tuple does not return Tuple instance
> ----------------------------------------------
>
> Key: OPENJPA-2618
> URL: https://issues.apache.org/jira/browse/OPENJPA-2618
> Project: OpenJPA
> Issue Type: Bug
> Components: jpa
> Affects Versions: 2.4.0
> Reporter: Oliver Gierke
>
> {code:java}
> TypedQuery<Tuple> query = em.createQuery("SELECT u.firstname from User u", Tuple.class);
> List<Tuple> result = query.getResultList();
> List<TupleElement<?>> elements = result.get(0).getElements();
> {code}
> This breaks at {{result.get(0)}} with {{java.lang.ClassCastException: java.lang.String cannot be cast to javax.persistence.Tuple}}.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)