cayenne-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eric Polino" <e...@campgroundautomation.com>
Subject joins
Date Thu, 22 May 2008 21:23:25 GMT
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'

TIA.

-- 
Eric Polino
Campground Automated Systems

Mime
View raw message