This is an automated email from the ASF dual-hosted git repository. mbo pushed a commit to branch JDO-778 in repository https://gitbox.apache.org/repos/asf/db-jdo.git
commit 61f6793eb2f081a3cffd8d7cf97214b76f236cd9 Author: Michael Bouschen <m...@apache.org> AuthorDate: Sun Mar 10 16:55:26 2019 +0100 JDO-778: Adding overloaded methods to JDOQLTypedQuery to create a correlated subquery --- api/src/main/java/javax/jdo/JDOQLTypedQuery.java | 36 +++++++++++++++++++++++- 1 file changed, 35 insertions(+), 1 deletion(-) diff --git a/api/src/main/java/javax/jdo/JDOQLTypedQuery.java b/api/src/main/java/javax/jdo/JDOQLTypedQuery.java index da04f38..9564374 100644 --- a/api/src/main/java/javax/jdo/JDOQLTypedQuery.java +++ b/api/src/main/java/javax/jdo/JDOQLTypedQuery.java @@ -343,11 +343,45 @@ public interface JDOQLTypedQuery<T> extends Serializable, Closeable { * @param candidate Candidate for the subquery * @param candidateAlias Alias for the candidate * @return The subquery - * @param <S> candidate type for subquery + * @param <S> Candidate type for subquery */ <S> JDOQLTypedSubquery<S> subquery(Class<S> candidate, String candidateAlias); /** + * Method to return a correlated subquery for use in this query. + * The candidate collection of the subquery is defined using a collection relationship of the outer query. + * To obtain the expression for the subquery to link it back to this query, call "result(...)" on the subquery. + * @param candidateCollection Expression defining the candidate collection for the subquery + * @param candidateAlias Alias for the candidate + * @return The subquery + * @param <E> Candidate type for subquery + */ + <E> JDOQLTypedSubquery<E> subquery(CollectionExpression<Collection<E>, E> candidateCollection, String candidateAlias); + + /** + * Method to return a correlated subquery for use in this query. + * The candidate collection of the subquery is defined using a list relationship of the outer query. + * To obtain the expression for the subquery to link it back to this query, call "result(...)" on the subquery. + * @param candidateList Expression defining the candidate collection for the subquery + * @param candidateAlias Alias for the candidate + * @return The subquery + * @param <E> Candidate type for subquery + */ + <E> JDOQLTypedSubquery<E> subquery(ListExpression<List<E>, E> candidateList, String candidateAlias); + + /** + * Method to return a correlated subquery for use in this query. + * The candidate collection of the subquery is defined using a map relationship of the outer query. + * To obtain the expression for the subquery to link it back to this query, call "result(...)" on the subquery. + * @param candidateMap Expression defining the candidate collection for the subquery + * @param candidateAlias Alias for the candidate + * @return The subquery + * @param <K> The key type of the map relationship + * @param <V> The value type the map relationship + */ + <K, V> JDOQLTypedSubquery<Map.Entry<K, V>> subquery(MapExpression<Map<K, V>, K, V> candidateMap, String candidateAlias); + + /** * Method to set the named parameters on this query prior to execution. * All parameter values specified in this method will only be retained until the subsequent query execution. * @param namedParamMap The map of parameter values keyed by their names.