public class Store
{
public virtual prop1 { get; set;}
public virtual int RegionID { get; set;}
public virtual Region Region { get; set;
}
public class Region
{
public virtual int RegionID { get; set;}
}
In the end my sql should look like
select * from store inner join region on store.regionid = region.regionid
How can I get the below to work to attain the inner join above.
Session.QueryOver<Store>()
.JoinQueryOver<Region>(s => s.Region)
To attain the inner join, you must setup the relationship between the Store entity and the Region entity in your NHibernate mappings.
You cannot specify the keys to join-on using the QueryOver API.
Your classes should look similar to this:
And your mappings should look similar to this: