You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "ASF subversion and git services (JIRA)" <ji...@apache.org> on 2015/04/14 00:23:12 UTC

[jira] [Commented] (OPENJPA-2571) Criteria Builder query generates extra alias when using multiselect.

    [ https://issues.apache.org/jira/browse/OPENJPA-2571?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14493190#comment-14493190 ] 

ASF subversion and git services commented on OPENJPA-2571:
----------------------------------------------------------

Commit 1673300 from [~jpaheath] in branch 'openjpa/branches/2.1.x'
[ https://svn.apache.org/r1673300 ]

OPENJPA-2571: Criteria Builder query generates extra alias when using multiselect.

> Criteria Builder query generates extra alias when using multiselect.
> --------------------------------------------------------------------
>
>                 Key: OPENJPA-2571
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-2571
>             Project: OpenJPA
>          Issue Type: Bug
>          Components: criteria
>    Affects Versions: 2.2.3, 2.4.0
>            Reporter: Heath Thomann
>            Priority: Critical
>         Attachments: OPENJPA-2571.test
>
>
> I have a scenario (see attached .test file) where an extra alias is generated for a query created by CriteriaBuilder.  For the given test, this SQL is generated:
> SELECT t0.empl_cnt FROM
> T_FACT_WORK_ASGNMT t0, T_DIM_DAY t1, T_DIM_DAY t3 
> WHERE (t0.CLNT_OBJ_ID = ? AND t1.ROLL_13_MNTH_IND = ? AND t0.pers_obj_id IN (
>    SELECT t2.pers_obj_id FROM T_FACT_WORK_ASGNMT t2 WHERE    
>    (t2.CLNT_OBJ_ID = ? AND t3.MNTH_STRT_DAY_KY >= ?))) 
> Notice that T_DIM_DAY is aliased twice.  
> If I do a 'toString' on the CriteriaQuery which the test creates, and then create/execute a query using the string, the generated query is exactly like the above SQL, minus the 'T_DIM_DAY t3'.  This would seem to tell me that we take a different path when creating/executing a query with a 'CriteriaQuery' as opposed to just a JPQL string.
> Thanks,
> Heath



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)