newbie: how to get all related objects?

From: johannes schmidt (e002753..tudent.tuwien.ac.at)
Date: Mon May 26 2003 - 05:30:51 EDT

  • Next message: johannes schmidt: "Re: newbie: how to get all related objects?"

    this seems to be a nasty question: i've got an entity adress, an entity
    person and an entity livesIn.
    Every person my live in n adresses and in every adresses my live n persons.
    so it's a m:n relationship.
    adress(
    adress_id integer,
    street string,
    ....
    )
    person(
    p_id integer,
    name,
    ...)
    livesIn(
    p_id integer,
    adress_id integer
    )
    My problem: how do I get all adresses where a certain person lives?
    I wantet to do something like that:
    (P_ID is the ID of a person)
    Expression e=ExpressionFactory.matchExp("P_ID",person.getP_ID());
    SelectQuery q=new SelectQuery(livesIn.class,e);
    ....
    but there has to be another way ( i think, because i don't want to add a
    P_ID attribute in the cayenne datamap).
    thanx,
    johannes

    ----- Original Message -----
    From: "Andrus Adamchik" <andru..bjectstyle.org>
    To: <cayenne-use..bjectstyle.org>
    Cc: <cayenne-deve..bjectstyle.org>
    Sent: Monday, May 26, 2003 5:49 AM
    Subject: Cayenne Beta 3 Released

    > Beta 3 is out.
    >
    > http://objectstyle.org/cayenne/
    >
    > Main focus is bug fixes.
    >
    > - Oracle BLOB/CLOB handling is fixed, including the arbitrary size
    > limit imposed by Oracle driver.
    > - API that was deprecated as of Beta 1 is removed. Your compiler will
    > tell you that :-). It is important to update Velocity class generation
    > templates if you customized them yourself (see RELEASE-NOTES for
    > details).
    > - Lots of Modeler problems resulting from incomplete model validation
    > were fixed.
    > - Fixed PK generation sequences bypassing the cache
    > - Fixed Oracle handling of entities with CHAR primary key columns.
    >
    > ... and many more...
    >
    > Andrus
    >



    This archive was generated by hypermail 2.0.0 : Mon May 26 2003 - 05:30:23 EDT