Re: Re: filtering to-many relationship list

From: Jürgen Saar (jsaa..eb.de)
Date: Mon Oct 18 2004 - 03:46:05 EDT

  • Next message: Andrus Adamchik: "Re: Re: filtering to-many relationship list"

    I've got a simular problem:

    Every user has a role and in this role I can specify
    which part of an order is invisible for this user.

    example:

    every order has a set of events for tracing the lifecycle
    but not all events should be visible for all users. So I need
    to filter the events in a way, that every user only sees
    the right events ...

    my idea
    -----------------------------------
    in CayenneDataObject:

    public void setFilter(String relation, Expression filter)
    -----------------------------------

    does this make sense? and if yes should I raise feature request?

    --- Juergen ---

    > In Cayenne there are a few generic approaches to filter objects
    > in-memory or as a part of a query. However in your particular case
    > (reading object based on PK), there is a much simpler solution -
    > DataObjectUtils.objectForPK(..) :
    >
    > http://objectstyle.org/cayenne/userguide/dataobjects/dataobjectutils.html
    >
    > Hope this helps
    > Andrus
    >
    > On Sep 24, 2004, at 8:47 PM, kalpesh modi wrote:
    >
    >> Hello Everyone,
    >> I just started using Cayenne and found it really very
    >> cool.
    >> I am stuck on one problem.
    >> I have a to-many relationship
    >> Class(student_id=fk)-->Student(student_id,student_ssn=pk).
    >> It returns a list of Student domain objects. I want to
    >> update Student but only a particular one. I want to
    >> filter the list based on a part of composite key i.e.
    >> based on the student_ssn key so that I get only the
    >> particular Student domain object that needs to be
    >> updated.
    >>
    >> Any pointers/help???
    >> Thanks,
    ________________________________________________________________
    Verschicken Sie romantische, coole und witzige Bilder per SMS!
    Jetzt neu bei WEB.DE FreeMail: http://freemail.web.de/?mc=021193



    This archive was generated by hypermail 2.0.0 : Mon Oct 18 2004 - 03:46:25 EDT