Issue Details (XML | Word | Printable)

Key: NUCCORE-836
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Unassigned
Reporter: Julian Schillinger
Votes: 0
Watchers: 0
Operations

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

Referenced custom class is not detached when mapped with Join-table

Created: 20/Apr/12 11:10 AM   Updated: 11/May/12 08:28 PM   Resolved: 20/Apr/12 01:08 PM
Component/s: None
Affects Version/s: 3.0.7
Fix Version/s: 3.0.11, 3.1.0.m3

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

Environment: Ubuntu Linux 11.10, Mysql Server 5.1.61, mysql-connnector-java-5.1.19, OpenJDK 1.6.42

Datastore: MySQL
Severity: Production


 Description  « Hide
Class A has a field of type B (custom class). In jdo file the field is marked to be mapped via join table (despite the 1:1 relationship). When detaching A, field of type B is NOT detached. The reason is that the "<join/>" flag in the jdo file somehow prevents that from happening. No error message is shown.

I understand that there is no need to have the join table for a 1:1 relationship between 2 classes. But developers may choose to do this in case they consider changing to a 1:n relationship later and want to avoid to change the database structure.

In case it is decide not to fix this issue, there should be an exception thrown instead so that users are aware that detaching does not work in this scenario.

Test case attached. Reproduce error as follows: (1) Create database, (2) Run schema tool, (3) Run Main.java with user input "1" to set up test rows, (4) Run with user input "2" to illustrate this scenario.




Sort Order: Ascending order - Click to sort in descending order
Julian Schillinger added a comment - 20/Apr/12 11:12 AM
Testcase

Andy Jefferson added a comment - 20/Apr/12 01:08 PM
SVN trunk and branches/3.0 include "N-1 UNI" fields in detach process now