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-1027
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Unassigned
Reporter: Andy Jefferson
Votes: 0
Watchers: 0
Operations

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

Embedded 1-1 with no <embedded> definition of sub-object and have a field marked as @PrimaryKey in embedded is badly interpreted with JDO

Created: 14/Apr/13 04:43 PM   Updated: 15/May/13 09:31 AM   Resolved: 14/Apr/13 06:07 PM
Component/s: Datastore Support, MetaData
Affects Version/s: 2.0.5, 2.1.4, 2.2.4, 3.0.10, 3.1.4, 3.2.1
Fix Version/s: 3.2.3


 Description  « Hide
If we have
class A
{
    @PrimaryKey
    long aId;

    @Embedded
    B b;
}
class B
{
    @PrimaryKey
    long bId;
    ...
}
it tries to create the table for A with a PRIMARY KEY of "A_ID" and "B_ID" since it grabs the metadata of the bId member of B and that has primary-key set.

Workaround : just define the <embedded> details of the embedded fields

Sort Order: Ascending order - Click to sort in descending order
Andy Jefferson added a comment - 14/Apr/13 06:07 PM
SVN trunk fixes this, removing the need for the workaround