This is by design, since ForumTopic is also a ForumPost. If you really want to change this behavior (I wouldn't recommend changing it) you'll need to define polymophism="explicit". See http://www.nhforge.org/doc/nh/en/index.html#mapping-declaration-class
On Mar 1, 9:30 am, Pbirkoff <[email protected]> wrote: > This problem has something to do with my previous question (http:// > groups.google.com/group/castle-project-users/t/316d0a05212e1fc5). > > I got two classes, one inheriting the other (using Single Table > Inheritance), ForumPost and ForumTopic. ForumTopic inherits ForumPost. > > The problem is, when I do a search for the number of ForumPost in the > database: > > DetachedCriteria d = DetachedCriteria.For(typeof(ForumPost)); > d.Add(Expression.Eq("Forum", this)); > return ActiveRecordBase.Count(typeof(ForumPost), d); > > I get the number of ForumPosts AND ForumTopics, so my count is > incorrect. > > Anybody got an idea how to solve this? -- You received this message because you are subscribed to the Google Groups "Castle Project Users" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/castle-project-users?hl=en.
