> http://issues.apache.org/jira/browse/JDO-633 Don't know how to do this
> since the absolute order is not required to be in the database, but
> there might be a way to create the database language (e.g. SQL) to do
> an ordered subselect and choose the "nth" item from the selection?
> Database-specific SQL? Can we support this in all databases? Is there
> a use-case?

Don't understand. A List has an order (whether it is an "indexed" List, or 
an "ordered" List (using JPA-style ordering criteria)). The user puts items 
in the List and persists the List. The user then wants to grab element at 
index 2. Storing the order in the datastore, in some way, is essential to 
support (indexed) Lists, hence querying should be straightforward. Since JDO 
doesn't define an ordering constraint, it is reasonable to assume that in JDO 
a List is an "indexed" List, hence retains the users ordering.

As far as testing goes, surely all you need to do is persist an object with a 
List with some elements in some order, and then do a query, assuming the same 
order as they had at the moment of persistence. Where does DB-specific SQL 
come into this ? surely that is the problem for the implementation.



-- 
Andy  (DataNucleus - http://www.datanucleus.org)

Reply via email to