Hi David,

The OJB collection-descriptor has attributes "orderby" and "sort":
        orderby CDATA #IMPLIED
        sort (ASC | DESC) "ASC"

(See repository.html for details) These attributes allow to setup 
sorting on collections.

All you have to do is to have a column in the item-table that can be 
used for a "ORDER BY X" Sql clause and to have a field in the items 
class that maps to this column.
In the collection-descriptor you tell OJB to sort the items in the 
collection according to this field.

cheers,
Thomas



David Corbin wrote:
> I know OJB supports lists/collections in various manners.  But it is my 
> guess, that it is completely unordered - that is, even when the Java 
> object is a List (ordered), nothing is done to ensure that the database 
> reflects this order, and that upon reload, the order may be different.
> 
> We are going to have several places where the list is ordered 
> (arbitrarily, by the user), and we need to preserve this ordering. 
> What's the best way to do this in OJB?
> 
> David
> 
> 
> -- 
> To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
> 
> 
> 
> 



--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to