cayenne-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Andrey Razumovsky <>
Subject Pre-ordering of relationships.
Date Thu, 31 Dec 2009 10:11:23 GMT
It'll be good to have preordering of relationships.
This means, getPaintingArray() can, if properly mapped, always return sorted
(e.g. by name) paintings. Most likely addTo(...) methods and updates of
painting name should keep list ordered properly.

Also those things should work for queries like EBJQL:
select a.paintingArray from Artist a...
-but this can be harder to implement.

Now about implementation. Easiest way would be adding orderings (our current
concept of Ordering class fits well) to ObjRelationship:
ObjRelationship paintingsArray = ...
paintingsArray.addOrdering(new Ordering("paintingName",

but this will not work for flattened rels. So we'll need either add
orderings for each component of the path (I don't like this way) or add
orderings for DbRels as well:
DbRelationship paintingsArray = ...
paintingsArray.addOrdering(new Ordering("PAINTING_NAME",
SortOrder.ASCENDING)); //notice db attr name

Then Obj rel will automatically pick orderings from underlying Db Rel(s)



  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message