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)

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

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 (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 with user input "1" to set up test rows, (4) Run with user input "2" to illustrate this scenario.

Julian Schillinger added a comment - 20/Apr/12 11:12 AM

Julian Schillinger made changes - 20/Apr/12 11:12 AM
Field Original Value New Value
Attachment [ 11642 ]
Andy Jefferson made changes - 20/Apr/12 01:05 PM
Project DataNucleus API JDO [ 10300 ] DataNucleus Core [ 10143 ]
Affects Version/s 3.0.7 [ 11443 ]
Affects Version/s 3.0.7 [ 11481 ]
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

Andy Jefferson made changes - 20/Apr/12 01:08 PM
Status Open [ 1 ] Resolved [ 5 ]
Fix Version/s 3.0.11 [ 11534 ]
Fix Version/s 3.1.0.m3 [ 11540 ]
Resolution Fixed [ 1 ]
Andy Jefferson made changes - 11/May/12 08:28 PM
Status Resolved [ 5 ] Closed [ 6 ]