Issue Details (XML | Word | Printable)

Key: NUCRDBMS-19
Type: New Feature New Feature
Status: Open Open
Priority: Major Major
Assignee: Unassigned
Reporter: Andy Jefferson
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
DataNucleus Store RDBMS

Support for 1-N bidir relation between impl of interface with collection of elements

Created: 10/Jan/07 10:22 AM   Updated: 30/Oct/13 12:51 PM
Component/s: ORM
Affects Version/s: None
Fix Version/s: None

File Attachments: 1. Zip Archive test.zip (5 kB)



 Description  « Hide
When we have

interface Container {}
class A implements Container
{
    Collection elements;
}
class B implements Container
{
    Collection elements;
}
class Element
{
    Container cont;
}

and the relation is bidirectional and we want to use a join table JPOX is currently incorrectly adding implementation FK columns to the Element table. It should operate just like a 1-N bidir

Andy Jefferson made changes - 10/Jan/07 10:23 AM
Field Original Value New Value
Attachment testcase.zip [ 10420 ]
Andy Jefferson made changes - 03/Feb/07 05:20 PM
Attachment testcase.zip [ 10420 ]
Erik Bengtson made changes - 06/Mar/08 10:32 PM
Project Core [ 10000 ] RDBMS [ 10111 ]
Key CORE-3130 RDBMS-109
Component/s Datastore Support [ 10128 ]
Affects Version/s 1.1.5 [ 10185 ]
Andy Jefferson made changes - 23/May/08 02:37 PM
Project JPOX RDBMS [ 10111 ] DataNucleus RDBMS [ 10144 ]
Key RDBMS-109 NUCRDBMS-19
Andy Jefferson made changes - 23/May/08 02:40 PM
Component/s ORM [ 10141 ]
Andy Jefferson made changes - 18/Apr/12 10:50 AM
Comment [ Test case demonstrating the classes and relation required to be supported ]
Andy Jefferson made changes - 18/Apr/12 10:50 AM
Comment [ Please attach test case again, since we lost it during JIRA upgrade ]
Andy Jefferson added a comment - 18/Apr/12 10:56 AM
Problem is in schema generation and is due to ReferenceMapping always generating columns. It needs to detect when part of a bidir relation with a join table.

Andy Jefferson added a comment - 18/Apr/12 11:52 AM
Testcase to demonstrate the situation. Test passes but creates additional FK fields in Element and doesn't create ReferenceMapping in join table

Andy Jefferson made changes - 18/Apr/12 11:52 AM
Attachment test.zip [ 11640 ]
Andy Jefferson added a comment - 29/Oct/13 07:54 PM
Note that NUCRDBMS-700 fixed one particular 1-N FK interface case

Andy Jefferson added a comment - 30/Oct/13 12:51 PM
SVN trunk has some code in ReferenceMapping at the top, commented out that would generate correct schema now ... that is it has a ReferenceMapping in the element but with no datastore columns, and has the join table with a simple FK to the element. Note that it should *not* create a ReferenceMapping in the join table (as implied by comment above). The particular example above will have join tabled for A_ELEMENTS and B_ELEMENTS, and then to get the Element.cont it will need to (somehow) do a UNION of A_ELEMENTS and B_ELEMENTS (likely in FetchRequest).