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

Andy Jefferson made changes - 14/Apr/13 05:19 PM
Field Original Value New Value
Project DataNucleus Store RDBMS [ 10144 ] DataNucleus Core [ 10143 ]
Key NUCRDBMS-666 NUCCORE-1027
Affects Version/s 3.2.1 [ 11914 ]
Affects Version/s 3.1.4 [ 11800 ]
Affects Version/s 3.0.10 [ 11501 ]
Affects Version/s 2.2.4 [ 11182 ]
Affects Version/s 2.1.4 [ 11074 ]
Affects Version/s 2.0.5 [ 10960 ]
Affects Version/s 2.0.5 [ 10961 ]
Affects Version/s 2.1.4 [ 11082 ]
Affects Version/s 2.2.4 [ 11183 ]
Affects Version/s 3.0.10 [ 11535 ]
Affects Version/s 3.1.4 [ 11811 ]
Affects Version/s 3.2.1 [ 11918 ]
Component/s Datastore Support [ 10155 ]
Component/s MetaData [ 10152 ]
Component/s Schema [ 10146 ]
Andy Jefferson added a comment - 14/Apr/13 06:07 PM
SVN trunk fixes this, removing the need for the workaround

Andy Jefferson made changes - 14/Apr/13 06:07 PM
Status Open [ 1 ] Resolved [ 5 ]
Fix Version/s 3.2.3 [ 11924 ]
Resolution Fixed [ 1 ]
Andy Jefferson made changes - 15/May/13 09:31 AM
Status Resolved [ 5 ] Closed [ 6 ]