这是一个权限的设计,有5个表,只是简单写出了逻辑结构,并未做类之间的关联。实际上打算是要做关联的,怎么关联,然后怎么映射呢?
//用户public class User{ public virtual int ID { get; protected set; } public virtual string UserName { get; set; }}
//用户权限public class UserRight{ public virtual int ID { get; protected set; } public virtual int UserID { get; set; } public virtual int GroupID { get; set; }}
//组public class Group{ public virtual int ID { get; protected set; } public virtual string Name { get; set; }}
//组权public class GroupRight{ public virtual int ID { get; protected set; } public virtual int GroupID { get; set; } public virtual int UnitRightID { get; set; }}
//单元权限public class UnitRight{ public virtual int ID { get; protected set; } public virtual string Name { get; set; }}
大概是这么个关联关系,对吧?怎么映射呢?User(1) -< UserRight(n) >- Group(1) -<GroupRight(n) >- UnitRight(1)
- -#
添加回答
举报
0/150
提交
取消