Hi Andy,Thanks for your comments. These should be clarified, and I'll do so as long as the spec is open for 2.1.
On Feb 10, 2007, at 10:57 AM, Andy Jefferson wrote:
Section 18.15.8 says <spec>If the array or list field is mapped using the mapped-by attribute in the field metadata, then the ordering can be mapped to a field in the same class. In this case, use the mapped-by attribute in the order metadata to name thefield containing the ordering data. </spec>This doesn't say whether the List is operated as an "indexed List" (where theJDO implementation will insert element index positions into the columndefined by the mapped-by field in the element table - and that this mapped-byfield should hence be integer based so it can store these indices), orwhether it will be an "ordered List" (like JPA, where the elements in the List are retrieved using the ordering defined by the mapped-by column) and the values defined by the element objects in that field will govern theposition in the list on retrieval.My interpretation has always been the first one, since if the user has takenthe time to insert elements into their List in an order then when they retrieve the List they should be in the same order.
Yes, ordered lists are problematic. There have been several instances where the ambiguity of the JPA spec has made people crazy.
The intent of the spec has always been that the index maintenance is the responsibility of the jdo implementation. The user has done enough by telling the implementation where things are supposed to go. The index is available for the implementation to make sure that the right order is maintained in the database to correspond to the order in memory.
Also in section 18.15.8 we also have <spec>The serialized attribute specifies that the key values are to be serializedinto the named column. </spec>I think that this should be removed since <order> has no serialized, and itsjust a cut and paste from somewhere.
Good catch. Thanks, Craig
-- Andy
Craig Russell Architect, Sun Java Enterprise System http://java.sun.com/products/jdo 408 276-5638 mailto:[EMAIL PROTECTED] P.S. A good JDO? O, Gasp!
smime.p7s
Description: S/MIME cryptographic signature
