[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-4726) Add support for delete-orphan cascading to <one-to-one/>

Steve Ebersole (JIRA) noreply at atlassian.com
Sat Jan 16 15:58:29 EST 2010


    [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-4726?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=35253#action_35253 ] 

Steve Ebersole commented on HHH-4726:
-------------------------------------

So as of http://fisheye.jboss.org/changelog/Hibernate?cs=18568 we currently have support for the following use cases:

1) bidirectional pk-based one-to-one.  In the pk-based usecase(s) only the non-constrained side can be declared for orphan delete.  Unidirectional may be supportable with the understanding that usage of "foreign" id generation would be precluded.  http://fisheye.jboss.org/browse/Hibernate/core/trunk/testsuite/src/test/java/org/hibernate/test/orphan/one2one/pk/bidirectional/Mapping.hbm.xml?r=18560#l26

2) bidirectional fk-based one-to-one with orphan delete declared on the non-constrained (<one-to-one/>) side.  Here the bidirectionality is needed to properly set up the needed property-ref
http://fisheye.jboss.org/browse/Hibernate/core/trunk/testsuite/src/test/java/org/hibernate/test/orphan/one2one/fk/bidirectional/Mapping.hbm.xml?r=18560#l26

3) bidirectional fk-based one-to-one with orphan delete declared on the constrained (<many-to-one unique="true"/>) side.
http://fisheye.jboss.org/viewrep/Hibernate/core/trunk/testsuite/src/test/java/org/hibernate/test/orphan/one2one/fk/reversed/bidirectional/Mapping.hbm.xml?r=18568#l26

4) unidirectional fk-based one-to-one with orphan delete declared on the constrained (<many-to-one unique="true"/>) side.
http://fisheye.jboss.org/viewrep/Hibernate/core/trunk/testsuite/src/test/java/org/hibernate/test/orphan/one2one/fk/reversed/unidirectional/Mapping.hbm.xml?r=18568#l26


Currently missing:
1) as mentioned above, support for fk-based one-to-one with orphan delete declared on the constrained side where the fk is composite (multiple columns).  This is really a function of the binding to determine where the fk is unique (not sure how <many-to-one unique="true"/> plays with nested <column/> defs.
2) any form of support for any of the allowed mappings using components.  The issue here is very fundamental in regards to how hibernate handles component values and the fact that at cascade time we do not know the original (now null) attribute value to actually do the deletion.  We may need to revert to pulling the snapshot here for the short term.

> Add support for delete-orphan cascading to <one-to-one/>
> --------------------------------------------------------
>
>                 Key: HHH-4726
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4726
>             Project: Hibernate Core
>          Issue Type: New Feature
>          Components: core
>            Reporter: Steve Ebersole
>            Assignee: Steve Ebersole
>             Fix For: 3.5.0-Beta-4
>
>          Time Spent: 1 day, 4 hours, 45 minutes
>  Remaining Estimate: 0 minutes
>
> JPA 2 requires support for this.  See section "11.1.37 OneToOne Annotation" wrt the orphanRemoval attribute

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://opensource.atlassian.com/projects/hibernate/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the hibernate-issues mailing list