Pb implement JOIN function

From: Francois Eyl (fey..maeur.com)
Date: Thu Feb 07 2008 - 16:44:28 EST

  • Next message: Malcolm Edgar: "[annou] Click Framework version 1.4 RC3 is now available"

    Hello guys,

    I have a question about how to join multiple object entities.

    Concrete sample :

    I have 2 tables with no foreign key between them (poor database).

    The first one is named SMASTER with 5 columns [SKDDATE (PK), SKDID (PK),
    JOBNAME (PK), JOBSTATUS, STSTATUS].
    The second one is named JSTATMAP with 3 columns, [JOBSTATUS (PK),
    STSTATUS (PK), FILTERCAT].

    I also have my cayenne user object entities named Smaster and Jstatmap
    with all their properties and their getters and setters.

    I'm trying to create a cayenne query to retrieve Smaster objects related
    to a specifique FILTERCAT value. In pure SQL the request would be
    something like that:

    SELECT SKDDATE, SKDID, JOBNAME, JOBSTATUS, STSTATUS
    FROM SMASTER
        INNER JOIN JSTATMAP ON
            JSTATMAP.JOBSTATUS=SMASTER.JOBSTATUS AND
            JSTATMAP.STSTATUS=SMASTER.STSTATUS
    WHERE JSTATMAP.FILTERCAT='CANCELLED'

    But I can't find the way with cayenne to do the same thing with Query
    and Expressions. Is there a way to do a "JOIN" between two or multiple
    cayenne object entity?

    Thanks.

    Francois



    This archive was generated by hypermail 2.0.0 : Thu Feb 07 2008 - 16:45:07 EST