Hello!
I am using hibernate (version2) with oracle database.
I have a table Sites with columns site_id and site_name.
I also have a table UserSites with columns user_id, user_name, site_id (FK to Site table).
I defined a class for UserInfo and also mapped it as a hibernate object.
class UserSites {
int user_id
string user_name
int site_id
string site_name
}
I do not want to map table Sites as we only use it for lookups.
If I were to use plain sql, I would write the following query:
select user_id, user_name, u.site_id, site_name from Sites s, UserSites u where u.site_id = s.site_id.
How can I map my class UserSites so that it joins these two tables and populates site_name with the correct data? (without creating the mapping for table Sites)
Thanks!
_________________ -julia
|