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

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

Commit 3914b4e2f13d49b7885c2ed980059eacf322fe58 in openjpa's branch 
refs/heads/OPENJPA-3025 from Richard Zowalla
[ https://gitbox.apache.org/repos/asf?p=openjpa.git;h=3914b4e2f ]

[OPENJPA-3025] Use try-with-resources in the test


> orphan-removal in an XML mapping is lost when the relation also cascades 
> remove
> -------------------------------------------------------------------------------
>
>                 Key: OPENJPA-3025
>                 URL: https://issues.apache.org/jira/browse/OPENJPA-3025
>             Project: OpenJPA
>          Issue Type: Bug
>            Reporter: Richard Zowalla
>            Assignee: Richard Zowalla
>            Priority: Major
>
> With an XML mapping, an element removed from a collection mapped with 
> {{orphan-removal="true"}} and a cascade that includes remove 
> ({{<cascade-remove/>}} or {{<cascade-all/>}}) is not deleted. Same bug as 
> OPENJPA-3024 for annotations, but older.
> Cause: {{XMLPersistenceMetaDataParser}} applies {{orphan-removal}} when the 
> element starts ({{setOrphanRemoval()}} sets {{CASCADE_AUTO}}) and the 
> cascades in {{finishField()}}, so {{setCascades()}} replaces it with 
> {{CASCADE_IMMEDIATE}}.
> Fix: apply orphan removal after the cascades, as OPENJPA-3024 does for the 
> annotation parser.



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

Reply via email to