Uploaded image for project: 'NHibernate'
  1. NHibernate
  2. NH-1262

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

    Details

      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

        Issue Links

          Activity

          Hide
          fabiomaulo Fabio Maulo added a comment -

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

          Show
          fabiomaulo Fabio Maulo added a comment - one-to-one with "all-delete-orphan" ?
          Hide
          colinjack 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
          colinjack 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
          gluip 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
          gluip 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
          lennynas 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
          lennynas 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 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 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
          michaelcharalambous Michael Charalambous added a comment -

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

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

          Merged to master @ 9a91dbb30492c08aef71c764ce7f43c63930ad05

          Show
          hazzik Alexander Zaytsev added a comment - Merged to master @ 9a91dbb30492c08aef71c764ce7f43c63930ad05

            People

            • Assignee:
              hazzik Alexander Zaytsev
              Reporter:
              colin.jack Colin Jack
            • Votes:
              25 Vote for this issue
              Watchers:
              25 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Who's Looking?