Issue Details (XML | Word | Printable)

Key: NUCCORE-672
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Andy Jefferson
Reporter: Andy Jefferson
Votes: 0
Watchers: 0
Operations

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

Nested embedded for mapped datastores can fail depending on order of embedded fields

Created: 04/Mar/11 07:26 PM   Updated: 01/Apr/11 03:24 PM   Resolved: 04/Mar/11 07:41 PM
Component/s: Persistence
Affects Version/s: 2.2.2, 2.2.3, 3.0.0.m1, 3.0.0.m2
Fix Version/s: 3.0.0.m3


 Description  « Hide
public class BaseClass
{
    private Long id;

    protected String s1;
    protected String s2;
    protected String s3;
    protected String s4;
    protected String s5;
}
public class MutableAmount extends BaseClass
{
    protected Euro baseAmount;
    protected AmountChanges totalDefinitive;
    protected AmountChanges totalTemporary;
}
public class AmountChanges
{
    protected Euro totalPositive;
    protected Euro totalNegative;
    protected String note;
}
public class Euro
{
    private long euroCent;
}

        <entity class="BaseClass">
                <attributes>
                        <id name="id">
                                <column name="id" nullable="false"/>
                                <generated-value strategy="TABLE"/>
                        </id>
                        <basic name="s1"/>
                        <basic name="s2"/>
                        <basic name="s3"/>
                        <basic name="s4"/>
                        <basic name="s5"/>
                </attributes>
        </entity>

        <entity class="MutableAmount">
                <attributes>
                        <embedded name="totalDefinitive">
                                <attribute-override name="totalPositive.euroCent">
                                        <column name="tot_var_pos_def" />
                                </attribute-override>
                                <attribute-override name="totalNegative.euroCent">
                                        <column name="tot_var_neg_def" />
                                </attribute-override>
                                <attribute-override name="note">
                                        <column name="noteDef" />
                                </attribute-override>
                        </embedded>

                        <embedded name="totalTemporary">
                                <attribute-override name="totalPositive.euroCent">
                                        <column name="tot_var_pos_temp" />
                                </attribute-override>
                                <attribute-override name="totalNegative.euroCent">
                                        <column name="tot_var_neg_temp" />
                                </attribute-override>
                                <attribute-override name="note">
                                        <column name="noteTemp" />
                                </attribute-override>
                        </embedded>

                        <embedded name="baseAmount">
                                <attribute-override name="euroCent">
                                        <column name="auro_base" />
                                </attribute-override>
                        </embedded>

                </attributes>
        </entity>

Andy Jefferson added a comment - 04/Mar/11 07:41 PM
SVN trunk (3.0) fixes this

Andy Jefferson made changes - 04/Mar/11 07:41 PM
Field Original Value New Value
Status Open [ 1 ] Resolved [ 5 ]
Assignee Andy Jefferson [ andy ]
Resolution Fixed [ 1 ]
Andy Jefferson made changes - 01/Apr/11 03:24 PM
Status Resolved [ 5 ] Closed [ 6 ]