NHibernate version: 1.2
I have the following two classes that implement the IActivity interface.
Code:
interface IActivity
{
Campaign MyCampaign { get; }
}
class Release : IActivity
{
Campaign MyCampaign { get { return campaign; } }
}
class Milestone : IActivity
{
Release Release {get {return release;} }
MyCampaign {get {return this.Release.MyCampaign ;} }
}
I need to query against IActivty and filter on the campaign.
Code:
session.CreateCriteria(typeof(IActivity)).Add(Expression.Eq("Campaign.Id", 1));
On the Release class I have MyCampaign mapped to a column, however on the Milestone class MyCampaign is not mapped at all because a Milestone has a Release which has a Campaign.
Obviously my query does not work because of this. Is there anyway in the mapping to tell nhibernate to join against the release to get the campaign?
Thanks.