Menu

#1 InverseMap can't have not null owner

closed-fixed
nobody
Core (19)
5
2003-02-26
2002-11-01
No

The inverse map implementation only works if the owner field is
allowed to be nullable or the owner is set explicitly before the value
object is put in the map.

This can easily be demonstrated by adding null-value="exception"
to the owner field in InverseMapValue.jdo, and running
MapFieldTest.

A workaround is to explicitly set the owner for the value before
adding it to the map. This can be demonstrated by adding to
InverseMapFieldTester.addMapValue

imv.setOwner(this);//first line of method

and replacing the assertion on line 105/106 with

mapValues.add(imv);

At the moment this issue makes inverse maps unusable without
the special workaround programming with databases such as
Firebird that require all columns in a candidate key to be not null.

Discussion

  • Matthew Cooper

    Matthew Cooper - 2002-11-06

    Logged In: YES
    user_id=219557

    This issue is true for cloudscape 5 (db2j) as well. That's why
    my patch for db2j failed the unit tests.

     
  • Mike Martin

    Mike Martin - 2003-02-26

    Logged In: YES
    user_id=582193

    Fixed as part of the work to add the Firebird adapter. The DB2J
    case has been fixed as well for 2.0beta3.

    Mike

     
  • Mike Martin

    Mike Martin - 2003-02-26
    • status: open --> closed-fixed
     

Log in to post a comment.