[
https://issues.apache.org/jira/browse/JDO-778?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Michael Bouschen updated JDO-778:
---------------------------------
Description:
I propose to add the following overloaded subquery methods to support
correlated subqueries using a relationship field of the from clause of the
subquery, e.g.
{{select firstname from org.apache.jdo.tck.pc.company.Employee }}
{{ where this.weeklyhours > }}
{{ (select AVG(e.weeklyhours) from this.department.employees e where
e.manager == this.manager)}}
{{<{color:#20999d}E{color}> JDOQLTypedSubquery<{color:#20999d}E{color}>
subquery(CollectionExpression<Collection<{color:#20999d}E{color}>,
{color:#20999d}E{color}> candidateCollection, String candidateAlias);}}
{{<{color:#20999d}E{color}> JDOQLTypedSubquery<{color:#20999d}E{color}>
subquery(ListExpression<List<{color:#20999d}E{color}>, {color:#20999d}E{color}>
candidateList, String candidateAlias);}}
{{<{color:#20999d}K{color}, {color:#20999d}V{color}>
JDOQLTypedSubquery<Map.Entry<{color:#20999d}K{color}, {color:#20999d}V{color}>>
subquery(MapExpression<Map<{color:#20999d}K{color}, {color:#20999d}V{color}>,
{color:#20999d}K{color}, {color:#20999d}V{color}> candidateMap, String
candidateAlias);}}
was:
I propose to add the following overloaded subquery methods to support
correlated subqueries using a relationship field of the from clause of the
subquery, e.g.
select firstname from org.apache.jdo.tck.pc.company.Employee
where this.weeklyhours >
(select AVG(e.weeklyhours) from this.department.employees e where e.manager
== this.manager)
{{<{color:#20999d}E{color}> JDOQLTypedSubquery<{color:#20999d}E{color}>
subquery(CollectionExpression<Collection<{color:#20999d}E{color}>,
{color:#20999d}E{color}> candidateCollection, String candidateAlias);}}
{{<{color:#20999d}E{color}> JDOQLTypedSubquery<{color:#20999d}E{color}>
subquery(ListExpression<List<{color:#20999d}E{color}>, {color:#20999d}E{color}>
candidateList, String candidateAlias);}}
{{<{color:#20999d}K{color}, {color:#20999d}V{color}>
JDOQLTypedSubquery<Map.Entry<{color:#20999d}K{color}, {color:#20999d}V{color}>>
subquery(MapExpression<Map<{color:#20999d}K{color}, {color:#20999d}V{color}>,
{color:#20999d}K{color}, {color:#20999d}V{color}> candidateMap, String
candidateAlias);}}
> Adding overloaded methods to JDOQLTypedQuery to create a correlated subquery
> -----------------------------------------------------------------------------
>
> Key: JDO-778
> URL: https://issues.apache.org/jira/browse/JDO-778
> Project: JDO
> Issue Type: Improvement
> Components: api
> Affects Versions: JDO 3.1
> Reporter: Michael Bouschen
> Priority: Critical
> Fix For: JDO 3.2
>
>
> I propose to add the following overloaded subquery methods to support
> correlated subqueries using a relationship field of the from clause of the
> subquery, e.g.
> {{select firstname from org.apache.jdo.tck.pc.company.Employee }}
> {{ where this.weeklyhours > }}
> {{ (select AVG(e.weeklyhours) from this.department.employees e where
> e.manager == this.manager)}}
> {{<{color:#20999d}E{color}> JDOQLTypedSubquery<{color:#20999d}E{color}>
> subquery(CollectionExpression<Collection<{color:#20999d}E{color}>,
> {color:#20999d}E{color}> candidateCollection, String candidateAlias);}}
> {{<{color:#20999d}E{color}> JDOQLTypedSubquery<{color:#20999d}E{color}>
> subquery(ListExpression<List<{color:#20999d}E{color}>,
> {color:#20999d}E{color}> candidateList, String candidateAlias);}}
> {{<{color:#20999d}K{color}, {color:#20999d}V{color}>
> JDOQLTypedSubquery<Map.Entry<{color:#20999d}K{color},
> {color:#20999d}V{color}>> subquery(MapExpression<Map<{color:#20999d}K{color},
> {color:#20999d}V{color}>, {color:#20999d}K{color}, {color:#20999d}V{color}>
> candidateMap, String candidateAlias);}}
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)