[hibernate-issues] [Hibernate-JIRA] Updated: (HHH-2572) NullPointerException when cascade-merge detached entity graph that contains null component property

Gail Badner (JIRA) noreply at atlassian.com
Thu Apr 19 16:26:04 EDT 2007


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

Gail Badner updated HHH-2572:
-----------------------------

    Attachment: HHH-2572-testcase-corrected.patch

I forgot to add a test file to HHH-2572.patch, so I'm attaching a corrected file, HHH-2572-testcase-corrected.patch . HHH-2572.patch can be disregarded.

The fix suggested in HHH-2542 (with a correction) fixed this issue and I verified that it did not break any unit tests. I will attach a patch for the fix to that issue.

> NullPointerException when cascade-merge detached entity graph that contains null component property
> ---------------------------------------------------------------------------------------------------
>
>                 Key: HHH-2572
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2572
>             Project: Hibernate3
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 3.2.3
>         Environment: hibernate 3.2.3 only
>            Reporter: Nguyen Hau Giang
>            Priority: Critical
>         Attachments: HHH-2572-testcase-corrected.patch, HHH-2572.patch, testCase.zip
>
>
> when merging detached entity graph whose leaf-entity contains null-component property, hibernate 3.2.3 will throw NPE. (leaf-entity level>2)
> No exception was thrown in hibenate 3.2.2
> Mapping:
> Parent -> Child -> GrandChild
> All associations is cascade.
> GrandChild contains a component property.
> Test Case:
> parent=<load>;
> child=parent.get1Child();
> GrandChild grandChild=new GrandChild();
> grandChild.setComponent(null);
> child.add(grandChild);
> evict(parent);//session is closed
> ...
> merge(parent);//merge in new sesson -> THROW NullPointerException
> for further detail, see attache test case.

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