-->
These old forums are deprecated now and set to read-only. We are waiting for you on our new forums!
More modern, Discourse-based and with GitHub/Google/Twitter authentication built-in.

All times are UTC - 5 hours [ DST ]



Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 
Author Message
 Post subject: polymorphic unmapped property join hint
PostPosted: Thu Aug 09, 2007 1:27 pm 
Beginner
Beginner

Joined: Wed Oct 04, 2006 8:57 am
Posts: 25
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.


Top
 Profile  
 
Display posts from previous:  Sort by  
Forum locked This topic is locked, you cannot edit posts or make further replies.  [ 1 post ] 

All times are UTC - 5 hours [ DST ]


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
© Copyright 2014, Red Hat Inc. All rights reserved. JBoss and Hibernate are registered trademarks and servicemarks of Red Hat, Inc.