Fluent Nhibernate HasMany mapping issue

北战南征 提交于 2019-12-06 14:43:18

The only way I could get this to work was by changing my mapping for GroupRight to the following:

public class GroupRightMap : ClassMap<GroupRight>
{
    public GroupRightMap()
    {

        Table("GROUP_RIGHT_COMPOSITE");
        CompositeId()
            .KeyReference(x => x.Group, "GROUP_ID")
            .KeyReference(x => x.Right, "RIGHT_NUM");

        References(x => x.Group, "GROUP_ID")
            .Not.Update()
            .Not.Insert()
            .Cascade.All();

        References(x => x.Right, "RIGHT_NUM")
            .Not.Update()
            .Not.Insert()
            .Cascade.All();

        Map(x => x.RightValue, "RIGHT_VALUE").Not.Nullable();
    }
}
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!