You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jdo-dev@db.apache.org by "Craig Russell (JIRA)" <ji...@apache.org> on 2008/08/06 19:44:44 UTC

[jira] Commented: (JDO-463) Clarify the behavior of an ordering column mapped to a user-visible field in the target class

    [ https://issues.apache.org/jira/browse/JDO-463?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12620342#action_12620342 ] 

Craig Russell commented on JDO-463:
-----------------------------------

I'm inclined to go with the first interpretation for now. If we have requests for additional functionality (multiple fields, ASC|DESC specification) we can address them later, by expanding the meaning of the mapped-by attribute to be a comma-separated list of field/property name and ASC|DESC flag. 

<proposed>
The field named in the mapped-by attribute in the order element must refer to a field or property of an integral type. This field is managed by the JDO implementation at flush time. 

If an instance of the target type is created and not explicitly added to the array or list on the other side, the instance is added to the array or list at the end.
<proposed>



> Clarify the behavior of an ordering column mapped to a user-visible field in the target class
> ---------------------------------------------------------------------------------------------
>
>                 Key: JDO-463
>                 URL: https://issues.apache.org/jira/browse/JDO-463
>             Project: JDO
>          Issue Type: Improvement
>          Components: specification
>    Affects Versions: JDO 2 maintenance release 1
>            Reporter: Craig Russell
>            Assignee: Craig Russell
>             Fix For: JDO 2 maintenance release 2
>
>
> 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 the 
> field containing the ordering data.
> </spec>
> This doesn't say whether the List is operated as an "indexed List" (where the 
> JDO implementation will insert element index positions into the column 
> defined by the mapped-by field in the element table - and that this mapped-by 
> field should hence be integer based so it can store these indices), or 
> whether 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 the 
> position in the list on retrieval. 
> Andy's (JPOX) interpretation has always been the first one, since if the user has taken 
> the time to insert elements into their List in an order then when they 
> retrieve the List they should be in the same order.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.