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

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

Commit bf200fc21d70ba82ce4215a92592fb9f87cf4c05 in openjpa's branch 
refs/heads/master from Paul King
[ https://gitbox.apache.org/repos/asf?p=openjpa.git;h=bf200fc21 ]

[OPENJPA-3092] Give criteria set operations the result of their first operand

Criteria set operations (CriteriaBuilder.union, unionAll, intersect, except)
built their compound QueryExpressions without projections, so a union of
CriteriaQuery<String> operands returned Object[] rows, constructed and tuple
operands were not packed, and in-memory distinct processing could drop the
duplicates of UNION ALL.

Move the handling OPENJPA-3091 added to JPQLExpressionBuilder into
QueryExpressions.useResultOfFirstSetOperand() and call it from
CriteriaSelectImpl as well.


> Criteria API set operations lose the projection of their first operand
> ----------------------------------------------------------------------
>
>                 Key: OPENJPA-3092
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-3092
>             Project: OpenJPA
>          Issue Type: Bug
>            Reporter: Richard Zowalla
>            Priority: Major
>             Fix For: 4.3.0
>
>
> OPENJPA-3091 gives JPQL set operations (UNION, INTERSECT, EXCEPT) the 
> projections, aliases and clauses of their first operand and sets distinct to 
> false on the compound. Criteria set operations (CriteriaBuilder.union, 
> unionAll, intersect, except) build their compound in 
> CriteriaSelectImpl.getQueryExpressions() the same way the JPQL builder did 
> before: without projections and with DISTINCT_AUTO. A union of 
> CriteriaQuery<String> operands therefore probably still returns Object[] rows 
> of length 1, and in-memory distinct processing may drop the duplicates of 
> UNION ALL.
> Apply the same handling to the criteria compound, ideally through a helper 
> shared with JPQLExpressionBuilder, and make the criteria set operation tests 
> in TestTypesafeCriteria (criteriaUnion, criteriaUnionAll, criteriaIntersect, 
> criteriaExcept) assert on the values instead of only on non-null results.



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to