You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@openjpa.apache.org by "Rick Curtis (JIRA)" <ji...@apache.org> on 2015/05/01 22:42:06 UTC
[jira] [Updated] (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:all-tabpanel ]
Rick Curtis updated OPENJPA-2571:
---------------------------------
Assignee: Heath Thomann
> 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
> Assignee: 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)