Persisting one table per class hierarchy using NHibernate without discriminator?
문제
I have an interface and a class which implements this interface.
public interface IPhase {
string Description { get; set; }
int Id { get; }
string Phase { get; set; }
}
public class Phase : IPhase {
// Implementation here...
}
Now, using NHibernate 2.1.2.GA, I wish to use a table-per-class-hierarchy to map the interface and its implementor, and indeed, I don't need a discriminator, as this implementor will be the only class persisted in this table. I haven't used NHibernate for about a year and a half now, and I'm suffering some memory blanks here...
I have read this question and answers which is related, except I'm not using FNH.
NHibernate Mapping: Save hierarchy to single table without discriminator
I wonder whether the
discriminator
attribute is obligatory while usingsubclass
?What shall my XML mapping look like in this particular context?
Thanks kindly for your help!
올바른 솔루션이 없습니다
제휴하지 않습니다 StackOverflow