[jboss-jira] [JBoss JIRA] Created: (EJBTHREE-843) @ManyToOne(cascade=CascadeType.REMOVE) produces delete of the reference of the relation, that is a nonsense

Christophe Gildas (JIRA) jira-events at jboss.com
Tue Jan 23 05:23:53 EST 2007


@ManyToOne(cascade=CascadeType.REMOVE) produces delete of the reference of the relation, that is a nonsense
-----------------------------------------------------------------------------------------------------------

                 Key: EJBTHREE-843
                 URL: http://jira.jboss.com/jira/browse/EJBTHREE-843
             Project: EJB 3.0
          Issue Type: Feature Request
    Affects Versions: EJB 3.0 RC9 - Patch 1, EJB 3.0 RC9 - FD, EJB 3.0 RC8 - FD, EJB 3.0 RC10 - FD, EJB 3.0 RC11 - FD
         Environment: Windows XP
            Reporter: Christophe Gildas


If I define a relation @ManyToOne(cascade=CascadeType.REMOVE), when an instance of the POJO where is defined this relation is deleted, that produces a attempt to delete the target of the relation, which is the "parent" of the current POJO, that is a nonsense.
In this case, like that the "on delete cascade" of Oracle, the expected behaviour would rather be that deleting the target of the relation produces the destruction of   all the instances of entities which have a foreign key of this target.
If I want to have this behaviour, I must define as much relations @OneToMany(cascade=CascadeType.REMOVE) in a POJO as this POJO has foireign keys
That can be very heavy, and a lot less flexible that to define this rule on each foreign key (as Oracle does).

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list