0
votes

Using objectify and GAE is it legal to store two objects in the datastore that have the same value for the field marked as @Id yet have unique values for the @Parent field ?

For example


item1 {
    @Id Long ( value 123 )
    @Parent Key ( value XYZ )
}

item2 {
    @Id Long ( value 123 )
    @Parent Key ( value ABC )
}
1

1 Answers

1
votes

Yes. Conceptually it helps to reverse the order of @Parent and @Id fields so that @Parent fields are first; ids are only unique for a given kind and parent.