Pre-ordering of relationships.

From: Andrey Razumovsky (razumovsky.andre..mail.com)
Date: Thu Dec 31 2009 - 05:11:23 EST

  • Next message: Andrus Adamchik: "Re: [jira] Commented: (CAY-1300) Format queries in QueryLogger"

    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",
    SortOrder.ASCENDING));

    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)

    Thoughts?

    -- 
    Andrey
    



    This archive was generated by hypermail 2.0.0 : Thu Dec 31 2009 - 05:12:17 EST