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

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

Commit 46fe1c4454745681cc7a16ac7987ed6034ec6c90 in openjpa's branch 
refs/heads/OPENJPA-3099 from Richard Zowalla
[ https://gitbox.apache.org/repos/asf?p=openjpa.git;h=46fe1c445 ]

[OPENJPA-3099] Remove @Test from the parameterized helper of TestBulkUpdate

JUnit cannot resolve the int parameter of simpleBulkUpdate(int), which
simpleBulkUpdate() calls for each value.


>  TYPE() of a single-valued path is not joined: bulk DELETE deletes all rows, 
> SELECT fails
> -----------------------------------------------------------------------------------------
>
>                 Key: OPENJPA-3099
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-3099
>             Project: OpenJPA
>          Issue Type: Bug
>            Reporter: Richard Zowalla
>            Assignee: Richard Zowalla
>            Priority: Major
>             Fix For: 4.3.0
>
>
> TYPE() applied to a relation path adds the table of the related entity to the 
> FROM clause without the join condition. With BulkRangeLine -> BulkRangeOrder 
> (SINGLE_TABLE, subclass BulkRangeRushOrder), 4 orders of which 2 are rush 
> orders, 2 lines each:
> {code}
> DELETE FROM BulkRangeLine l WHERE TYPE(l.order) = BulkRangeRushOrder
> {code}
> issues on Derby
> {code}
> DELETE FROM BRG_LINE WHERE ID IN (SELECT DISTINCT t1.ID FROM BRG_ORDER t0, 
> BRG_LINE t1 WHERE (t0.ORDER_TYPE = 'BulkRangeRushOrder'))
> {code}
> The cross join matches every line, so all 8 lines are deleted instead of the 
> 4 lines of the rush orders. MySQL produces the same cross join (DELETE t1 
> FROM BRG_ORDER t0, BRG_LINE t1 ...).
> The same condition in a SELECT is not joined either and fails on Derby:
> {code}
> SELECT COUNT(l) FROM BulkRangeLine l WHERE TYPE(l.order) = BulkRangeRushOrder
> {code}
> Column reference 'T0.ID' is invalid ... \{SELECT t0.ID, COUNT(t1.ID) FROM 
> BRG_ORDER t0, BRG_LINE t1 WHERE (t0.ORDER_TYPE = 'BulkRangeRushOrder')}
> Expected: the path is joined (t1.ORDER_ID = t0.ID), 4 lines are deleted, and 
> the count is 4.
> Reproduced on master (86e153ab7) with the entities of 
> TestBulkSingleTableRange (OPENJPA-3094); found while working on OPENJPA-3098.



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

Reply via email to