[hibernate-issues] [Hibernate-JIRA] Created: (HHH-4740) JPA 2 NOT IMPLEMENTED: @OneToMany with orphanRemoval

Samuel Halliday (JIRA) noreply at atlassian.com
Sun Dec 27 09:48:32 EST 2009


JPA 2 NOT IMPLEMENTED: @OneToMany with orphanRemoval
----------------------------------------------------

                 Key: HHH-4740
                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-4740
             Project: Hibernate Core
          Issue Type: Bug
          Components: core
    Affects Versions: 3.5.0-Beta-2
            Reporter: Samuel Halliday
         Attachments: WebJpa.zip

JPA 2 finally managed to fill the hole that @org.hibernate.annotations.Cascade(value=org.hibernate.annotations.CascadeType.DELETE_ORPHAN) was filling. Now @OneToMany has a (orphanRemoval = true) element - which should be trivial to implement in Hibernate 3.5 because it has exactly the same functionality as DELETE_ORPHAN.

However, to my surprise, 3.5 Beta 2 does not implement that much desired feature/fix of JPA 2.

The good news is that the corresponding @ManyToOne(optional = false) JPA 2 annotation seems to be working just dandy.

I've attached a failing J2EE Web Application to demonstrate the failure. One might need to test across sessions to ensure that the DELETE_ORPHAN behaviour is as expected. The application is a modification of the NetBeans Web JPA Sample project and is set up to run on a Glassfish v3 server with Hibernate 3.5 installed via the Update Tool. (i.e. assumes Hibernate is installed on the J2EE server).

To run the test, add an entry to the database through the web interface.

You can uncomment the line in the Person entity class to use DELETE_ORPHAN and see that the test case passes when using the hibernate extension.


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