[hibernate-issues] [Hibernate-JIRA] Commented: (HHH-1594) Add on-delete="cascade" support to unidirectional *ToOne relationships.

Martin Beránek (JIRA) noreply at atlassian.com
Thu Oct 7 02:30:58 EDT 2010


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

Martin Beránek commented on HHH-1594:
-------------------------------------

This option is available in Annotations, so why not in xml mapping file?

> Add on-delete="cascade" support to unidirectional *ToOne relationships.
> -----------------------------------------------------------------------
>
>                 Key: HHH-1594
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-1594
>             Project: Hibernate Core
>          Issue Type: Improvement
>          Components: core
>         Environment: Hibernate 3.1.x, any dialect with cascading deletes.
>            Reporter: Steve Bazyl
>
> Currently the on-delete="cascade" option is only available on bi-directional/inverse collections.  However, there are some instances where we don't want the collections on the parent side of the relationship, creating a unidirection relationship from child to parent.  It would be nice to be able to do something like:
> <class name="Parent">
>   ....
> </class>
> <class name="Child">
>  ...
>   <many-to-one name="parent" on-delete="cascade"/>
> </class>
> So that child entries are deleted when the parent goes away.  Obviously in this particular example it would be OK to add the collection, but in the actual situation we'd like this in the collection would serve no practical purpose.
> It's not critical by any means -- we can just tewak the schema by hand and that's fine.  But it seems like an easy enough thing to add and would make the schema generation/update tools a little more robust.

-- 
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