Re: joins

From: Eric Polino (eri..ampgroundautomation.com)
Date: Thu May 22 2008 - 17:25:24 EDT

  • Next message: Mike Kienenberger: "Re: joins"

    On Thu, May 22, 2008 at 5:23 PM, Eric Polino
    <eri..ampgroundautomation.com> wrote:
    > Given three tables (This is not accurate SQL syntax...but you get the point).
    >
    > Reservation {
    > ...
    > siteId int foreign key with Site,
    > ...
    > }
    >
    > Site {
    > ...
    > siteId int primary key,
    > typeId int foreign key with SiteType,
    > ...
    > }
    >
    > SiteType {
    > ...
    > siteTypeId int primary key,
    > name varchar(32),
    > ...
    > }
    >
    > How can I do the following SQL statement using Expression,
    > ExpressionFactory, SelectQuery, etc?
    >
    > select * from Reservation r, Site s, SiteType st where r.siteId =
    > s.siteId and s.typeId = st.siteTypeId and st.name = 'foo'
    >

    I'm actually trying to get Reservation objects, so it's not '*' I'm
    selecting but more like r.field1, r.field2,... But Cayenne can take
    care of that for me when the time comes I'm sure.

    > TIA.
    >
    > --
    > Eric Polino
    > Campground Automated Systems
    >

    -- 
    Eric Polino
    Campground Automated Systems
    



    This archive was generated by hypermail 2.0.0 : Thu May 22 2008 - 17:25:55 EDT