, . , , - .
PostRelation , .
--- PostRelationMap
Id(x => x.Id, "PostRelationId").GeneratedBy.Identity();
References(x => x.ParentPost, "ParentPostId")
.ForeignKey("FK_PostRelation_ParentPost")
.Fetch.Join()
.LazyLoad();
References(x => x.ChildPost, "ChildPostId")
.ForeignKey("FK_PostRelation_ChildPost")
.Fetch.Join()
.LazyLoad();
Map(x => x.RelationshipType).CustomType<int>().Not.Nullable();
--- PostMap
HasMany(x => x.ChildPosts)
.Access.CamelCaseField(Prefix.Underscore)
.Cascade.AllDeleteOrphan()
.KeyColumn("ChildPostId")
.LazyLoad();