DataNucleus JIRA is now in read-only mode. Raise any new issues in GitHub against the plugin that it applies to. DataNucleus JIRA will remain for the foreseeable future but will eventually be discontinued
Issue Details (XML | Word | Printable)

Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Unassigned
Reporter: Andy Jefferson
Votes: 0
Watchers: 0

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

Schema handling for M-N is non-optimal : creates 2 CollectionTables and requires user to define column names otherwise can fail

Created: 19/Dec/13 07:30 PM   Updated: 21/Dec/13 11:37 AM   Resolved: 20/Dec/13 11:43 AM
Component/s: ORM, Schema
Affects Version/s: 3.0.10, 3.1.5, 3.2.9
Fix Version/s: 3.2.10

 Description  « Hide
When we have a M-N relation (Set) between Customer(suppliers) and Supplier(customers) we want a single join table to handle this relation. What we currently get are 2 CollectionTable objects internally. This works fine if the user specifies the names of the columns of the join table since then it can line them up. If the user omits the schema mapping then we can get the column names the wrong way around on one of these CollectionTable objects resulting in an exception when inserting an object into the join table.

We should either
1). Sort out the column generation for the CollectionTable so that it looks to the owner of the relation to name the columns when not provided
2). Just have a single CollectionTable, for the owner field, and use that when persisting the other side.

Andy Jefferson added a comment - 20/Dec/13 11:43 AM
GitHub master fixes DNIdentifierFactory/DN2IdentifierFactory to cater for M-N join table columns from the non-owner side

Andy Jefferson made changes - 20/Dec/13 11:43 AM
Field Original Value New Value
Status Open [ 1 ] Resolved [ 5 ]
Fix Version/s 3.2.10 [ 12061 ]
Resolution Fixed [ 1 ]
Andy Jefferson made changes - 21/Dec/13 11:37 AM
Status Resolved [ 5 ] Closed [ 6 ]