Re: filtering objects in relation

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Tue Dec 03 2002 - 13:37:09 EST

  • Next message: Holger Hoffstätte: "Re: sort attribute for referenced relation"

    Martin,

    Another tip. If you used "generation gap" pattern for your data objects,
    i.e. you have a subclass/superclass pair for each DataObject class, you can
    wrap this in a convenience method in a Project subclass

    publi class Project extends _Project {
     ...

     public List getTasksAfterDate(Date d) {
        Expression exp = ...;
        return exp.filterObjects(getToTaskArray());
     }
    }

    Andrus

    Andrus Adamchik writes:

    > martin ruff writes:
    >
    >> where toTaskArray is the relation to my taksk from the projects, so if I
    >> call myproject.getToTaskArray cayenne would return only the objects that
    >> qualify for the expression above, this would be very nice and a lot less
    >> code for me to write.
    >> but thanks again it works, but I'm still curious, if my idea above is
    >> somehow applicable with cayenne
    >> martin
    >
    > Martin, like I mentioned in my other email that I sent directly to you,
    > you can use Expression.filterObjects() for in memory list filtering.
    >
    > Andrus
     



    This archive was generated by hypermail 2.0.0 : Tue Dec 03 2002 - 13:37:13 EST