Uploaded image for project: 'Hibernate ORM'
  1. Hibernate ORM
  2. HHH-9663

Orphan removal does not work for OneToOne relations

    Details

    • Bug Testcase Reminder (view):

      Bug reports should generally be accompanied by a test case!

    • backPortable:
      Backport?
    • Last commented by a user?:
      true

      Description

      According to JPA 2.1 specification (page 476) if an entity is removed from the one to one relation (by setting the reference to null) and the relation is marked with orphan removal, the referenced entity should be deleted from the database.

      When I created one sided (no reverse reference) one to one relationship between two entities and set the orphan removal attribute to true, the referenced object is still in database after setting reference to null.

      If you have any questions/suggestions feel free to ask.

        Attachments

        1. Application.java
          0.6 kB
        2. Dao.java
          1 kB
        3. File.java
          0.5 kB
        4. FileContent.java
          0.2 kB

          Issue links

            Activity

              People

              • Votes:
                12 Vote for this issue
                Watchers:
                11 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: