[hibernate-issues] [Hibernate-JIRA] Updated: (HHH-3167) When an entity is deleted, remove it from unidirectional one-to-many collection on join tables

Gail Badner (JIRA) noreply at atlassian.com
Wed Mar 5 17:02:33 EST 2008


     [ http://opensource.atlassian.com/projects/hibernate/browse/HHH-3167?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Gail Badner updated HHH-3167:
-----------------------------

    Description: 
Currently, when an entity in a collection mapped as a one-to-many on a join table is deleted, it is not automatically removed from the collection. This causes ConstraintViolationException to be thrown when the row is deleted from the entity table. This is because the join table still refers to that row.

The fix should delete the rows in the join table that refer to the entity before the entity iteslf is deleted.

ConstraintViolationException is not thrown when the one-to-many association is on a foreign key, or when the one-to-many is bidirectional.

This may also happen with unidirectional many-to-many associations since they also use a join table, but I have not check that scenario yet.
        Summary: When an entity is deleted, remove it from unidirectional one-to-many collection on join tables  (was: When an entity is deleted, reemove it from unidirectional one-to-many collection on join tables)

> When an entity is deleted, remove it from unidirectional one-to-many collection on join tables
> ----------------------------------------------------------------------------------------------
>
>                 Key: HHH-3167
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-3167
>             Project: Hibernate3
>          Issue Type: Sub-task
>            Reporter: Gail Badner
>            Assignee: Gail Badner
>
> Currently, when an entity in a collection mapped as a one-to-many on a join table is deleted, it is not automatically removed from the collection. This causes ConstraintViolationException to be thrown when the row is deleted from the entity table. This is because the join table still refers to that row.
> The fix should delete the rows in the join table that refer to the entity before the entity iteslf is deleted.
> ConstraintViolationException is not thrown when the one-to-many association is on a foreign key, or when the one-to-many is bidirectional.
> This may also happen with unidirectional many-to-many associations since they also use a join table, but I have not check that scenario yet.

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