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;
|
|
|
|
|
using System.Collections.Generic;
|
2011-01-30 07:14:05 +00:00
|
|
|
|
|
|
|
|
|
namespace Tanshu.Accounts.Entities.Auth
|
|
|
|
|
{
|
|
|
|
|
public class UserGroup
|
|
|
|
|
{
|
2014-10-12 09:41:45 +00:00
|
|
|
|
public virtual Guid UserGroupID { get; set; }
|
2011-01-30 07:14:05 +00:00
|
|
|
|
public virtual User User { get; set; }
|
|
|
|
|
public virtual Group Group { get; set; }
|
|
|
|
|
}
|
2014-10-12 09:41:45 +00:00
|
|
|
|
public class UserGroupMap : ClassMapping<UserGroup>
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
public UserGroupMap()
|
|
|
|
|
{
|
|
|
|
|
Table("Auth_UserGroups");
|
|
|
|
|
Schema("dbo");
|
|
|
|
|
Lazy(true);
|
|
|
|
|
Id(x => x.UserGroupID, map => map.Generator(Generators.GuidComb));
|
|
|
|
|
ManyToOne(x => x.User, map =>
|
|
|
|
|
{
|
|
|
|
|
map.Column("UserID");
|
|
|
|
|
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
|
|
|
|
}
|