[hibernate-issues] [Hibernate-JIRA] Closed: (HHH-2320) Regression: optional properties under a <join> tag no longer update properly

Gail Badner (JIRA) noreply at atlassian.com
Wed Aug 15 18:42:13 EDT 2007


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

Gail Badner closed HHH-2320.
----------------------------


> Regression: optional properties under a <join> tag no longer update properly
> ----------------------------------------------------------------------------
>
>                 Key: HHH-2320
>                 URL: http://opensource.atlassian.com/projects/hibernate/browse/HHH-2320
>             Project: Hibernate3
>          Issue Type: Bug
>          Components: core
>    Affects Versions: 3.2.0.cr4, 3.2.0.cr5, 3.2.0.ga, 3.2.1
>         Environment: hibernate 3.2.0.cr4 through 3.2.1.ga
> hsql 1.8.0.7 and Oracle 9i
>            Reporter: Chris Jones
>            Assignee: Gail Badner
>             Fix For: 3.2.6, 3.3
>
>         Attachments: HHH-2320-test.patch, HHH-2320.patch, OptionalJoinTest.jar
>
>
> This was specifically introduced with the revision 10217 changes on the 3.2 branch in src/org/hibernate/persister/entity/AbstractEntityPersister.java
> Given the following setup:
> <class name="Thing">
>   <id .../>
>   <join table="JOIN_TABLE" optional="true">
>     <key column="THING_ID" not-null="true"/>
>     <property name="joinedProperty" column="JOINED_PROPERTY"/>
>   </join>
> </class>
> scenario:
> Thing thing1 = new Thing();
> thing1.setJoinedProperty("thing1");
> save(thing1);
> // a record in the JOIN_TABLE is created properly and updates on the property can occur
> Thing thing2 = new Thing();
> thing2.setJoinedProperty(null);
> save(thing2);
> // no record in JOIN_TABLE is created
> thing2.setJoinedProperty("thing2");
> save(thing2);
> // in revision 10216, hibernate correctly runs an INSERT to create a JOIN_TABLE record with the value "thing2"
> // in revision 10217, hibernate incorrectly runs an UPDATE to try and update a non-existant record in the JOIN_TABLE with the thing2 id
> It looks like the expectation.verifyOutcome() method should be throwing a StaleStateException if the attempted update effects 0 rows.
> I will try and get an official hibernate testcase going and possibly a patch, but I wanted to enter this now in case there is something I'm missing that makes this change in functionality intentional.

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