Re: subselect query

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Tue Jan 18 2005 - 11:13:53 EST

  • Next message: André Luiz do Nascimento Sousa: "Testing Spring + Cayenne Integration / Architectural Doubts"

    SQLTemplate is one solution... Another one that does not require raw sql
    is described in the FAQ:

    http://objectstyle.org/cayenne/faq/develop.html#not-query

    It will work fine if you don't have too many user records, but won't scale
    as well as SQLTemplate with subselect.

    Andrus

    > You could always use the SQLTemplate Class...
    >
    > SQLTemplate selectQuery = new SQLTemplate(Artist.class, "select * from
    > ARTIST", true);
    >
    >
    > http://objectstyle.org/cayenne/userguide/fetch/sqltemplate.html
    >
    >
    > --
    > Joshua T. Pyle
    > Go has always existed.
    >
    > On Tue, 18 Jan 2005 09:00:06 -0700, moraru_et..pymac.com
    > <moraru_et..pymac.com> wrote:
    >> please tell me how to model in cayenne this kind of query:
    >>
    >> select * from employee where employee.id not in (select id_emp from
    >> depemp where id_dept='100').
    >>
    >> i want to select the users who are outside the departmnet with id=100
    >>
    >> the tables are department, employee and the n:m relation is mapped
    >> with the table depemp.
    >>



    This archive was generated by hypermail 2.0.0 : Tue Jan 18 2005 - 11:13:54 EST