Hello,
I can't figure out how to create the mapping file for this particular
use case. The discriminator field should be 'Type'.
As you can see there is multiple inheritance and one of the inherited
classes actually maps to a different table ([PostComment]). There is a
many-to-one association between the two tables.
Could someone show me how to do the mapping. I've posted what I got so
far, is it correct ? (I've intentionally skipped some properties).
How do I integrate the mapping for PostComment ?
[Post] {PostID, DateCreated, Content, URL, Type, Headline, SourceID,
Readership, NumberOfHits}
[PostComment] {PostCommentID, PostID, DateCreated, Content}
Class PostBase
{
int PostBaseID;
string Content;
date DateCreated;
string URL;
}
Class Post : Postbase
{
string Headline;
int SourceID;
}
Class MSMPost : PostBase, Post
{
int Readership;
}
Class CGMPost : PostBase, Post
{
int NumberOfHits
}
Class PostComment : PostBase
{
}
<class name=”Postbase” table=”Post” discriminator-value=”POSTBASE”
abstract=”true”>
<id name=”PostBaseID” column=”PostID”>
<discriminator column=”Type” type=”string” not-null=”true” />
<property name=”Content” type=”string” column=”Content” />
.
.
.
<subclass name=”Post” discriminator-value=”POST” >
<property name=”Headline” column=”Headline” />
.
.
.
</subclass>
<subclass name=”CGMPost” discriminator-value=”CGMPOST” />
<subclass name=”MSMPost” discriminator-value=”MSMPOST” />
How do I map PostComment ?
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"nhusers" 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/nhusers?hl=en
-~----------~----~----~----~------~----~------~--~---