2011-01-30 07:14:05 +00:00
|
|
|
|
using System;
|
|
|
|
|
using System.Runtime.Serialization;
|
2011-02-18 16:54:48 +00:00
|
|
|
|
using Tanshu.Accounts.Contracts;
|
2014-10-12 09:41:45 +00:00
|
|
|
|
using NHibernate.Mapping.ByCode.Conformist;
|
|
|
|
|
using NHibernate.Mapping.ByCode;
|
2011-01-30 07:14:05 +00:00
|
|
|
|
|
|
|
|
|
namespace Tanshu.Accounts.Entities.Auth
|
|
|
|
|
{
|
|
|
|
|
public class RoleGroup
|
|
|
|
|
{
|
2014-10-12 09:41:45 +00:00
|
|
|
|
public virtual Guid RoleGroupID { get; set; }
|
2011-01-30 07:14:05 +00:00
|
|
|
|
public virtual Role Role { get; set; }
|
|
|
|
|
public virtual Group Group { get; set; }
|
|
|
|
|
}
|
2014-10-12 09:41:45 +00:00
|
|
|
|
public class RoleGroupMap : ClassMapping<RoleGroup>
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
public RoleGroupMap()
|
|
|
|
|
{
|
|
|
|
|
Table("Auth_RoleGroups");
|
|
|
|
|
Schema("dbo");
|
|
|
|
|
Lazy(true);
|
|
|
|
|
Id(x => x.RoleGroupID, map => map.Generator(Generators.GuidComb));
|
|
|
|
|
ManyToOne(x => x.Role, map =>
|
|
|
|
|
{
|
|
|
|
|
map.Column("RoleID");
|
|
|
|
|
map.NotNullable(true);
|
|
|
|
|
map.Cascade(Cascade.None);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
ManyToOne(x => x.Group, map =>
|
|
|
|
|
{
|
|
|
|
|
map.Column("GroupID");
|
|
|
|
|
map.NotNullable(true);
|
|
|
|
|
map.Cascade(Cascade.None);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
2011-01-30 07:14:05 +00:00
|
|
|
|
}
|