NHibernate
  1. NHibernate
  2. NH-1262

Cascade of "all-delete-orphan" not supported for one-to-one

    Details

    • Type: New Feature New Feature
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: 1.2.0.GA
    • Fix Version/s: None
    • Component/s: Core
    • Labels:
      None

      Description

      It would be useful if "all-delete-orphan" was supported as a cascade option for one-to-one mappings. If it is not to be supported then it would be useful if the schema disallowed it or if NHibernate threw an exception when you tried to use it.

      This is related to the following forum entry:
      http://forum.hibernate.org/viewtopic.php?t=961144&highlight=onetoone+cascade

        Activity

        Hide
        Fabio Maulo added a comment -

        one-to-one with "all-delete-orphan" ?

        Show
        Fabio Maulo added a comment - one-to-one with "all-delete-orphan" ?
        Hide
        Colin Jack added a comment -

        Yup, actually the example in the forum is pretty much the sort of situation we have:

        In User:
        <many-to-one name="address" class="Address" column="AddressId" unique="true" cascade="all-delete-orphan" />

        In Address:
        <one-to-one name="user" class="User" property-ref="address" />

        Show
        Colin Jack added a comment - Yup, actually the example in the forum is pretty much the sort of situation we have: In User: <many-to-one name="address" class="Address" column="AddressId" unique="true" cascade="all-delete-orphan" /> In Address: <one-to-one name="user" class="User" property-ref="address" />
        Hide
        martijn muurman added a comment -

        Any chance this feature is coming to NHibernate? In Hibernate it is fixed. See https://hibernate.onjira.com/browse/HHH-4726

        Show
        martijn muurman added a comment - Any chance this feature is coming to NHibernate? In Hibernate it is fixed. See https://hibernate.onjira.com/browse/HHH-4726
        Hide
        Lenny Nas added a comment -

        As mentioned, this is fixed in Hibernate.
        I was a bit suprised when I discovered that this feature lacks in NHibernate.
        Any plan for when this is fixed?

        Show
        Lenny Nas added a comment - As mentioned, this is fixed in Hibernate. I was a bit suprised when I discovered that this feature lacks in NHibernate. Any plan for when this is fixed?
        Hide
        Oskar Berggren added a comment -

        There is no plan. Anyone willing to work on porting the feature should do so, and submit pull requests on github (preferably formatted for easy reviewing).

        Show
        Oskar Berggren added a comment - There is no plan. Anyone willing to work on porting the feature should do so, and submit pull requests on github (preferably formatted for easy reviewing).
        Hide
        Michael Charalambous added a comment -

        Added pull request for this issue. See https://github.com/nhibernate/nhibernate-core/pull/171

        Show
        Michael Charalambous added a comment - Added pull request for this issue. See https://github.com/nhibernate/nhibernate-core/pull/171

          People

          • Assignee:
            Unassigned
            Reporter:
            Colin Jack
          • Votes:
            24 Vote for this issue
            Watchers:
            23 Start watching this issue

            Dates

            • Created:
              Updated:

              Who's Looking?