我有以下结构。
1) GroupMember.cs
public class GroupMember
{
public virtual int Id { get; set; }
public virtual SystemUser User { get; set; }
public virtual Group Group { get; set; }
public virtual IList<Group> GroupDetail { get; set; }
public virtual IList<SystemUser> SystemUserDetail { get; set; }
// Few more Properties are there
}
2) 系统用户.cs
public class SystemUser
{
public virtual int Id{get;set;}
public virtual string DisplayName{get;set;}
// Few more Properties are there
}
休眠文件
小组成员
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="NSP.DataModel"
namespace="NSP.DataModel.Account">
<class name="GroupMember" entity-name="SysGroupMember" table="SYS_DEF_GROUP_MEMBERS">
<id name="Id" column="id" type="Int32">
<generator class="identity"/>
</id>
<many-to-one entity-name="SysGroup" name="Group" column="GroupID" not-null="true" cascade="none"/>
<many-to-one entity-name="SysUser" name="User" column="UserID" not-null="false" cascade="none"/>
<property name="Status" type="int" not-null="false">
<column name="Status" not-null="false"/>
</property>
<property name="CreatedDate" type="datetime" not-null="false">
<column name="CreatedDate"/>
</property>
<property name="CreatedBy" type="int" not-null="false">
<column name="CreatedBy"/>
</property>
<property name="UpdatedDate" type="datetime" not-null="false">
<column name="UpdatedDate"/>
</property>
<property name="UpdatedBy" type="int" not-null="false">
<column name="UpdatedBy"/>
</property>
<bag name="GroupDetail" inverse="true">
<key column="Id"/>
<one-to-many entity-name="SysGroup"/>
</bag>
<bag name="SystemUserDetail">
<key column="Id"/>
<one-to-many entity-name="SysUser"/>
</bag>
</class>
</hibernate-mapping>
系统用户
<?xml version="1.0" encoding="utf-8" ?>
<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2" assembly="NSP.DataModel" namespace="NSP.DataModel.Authentication">
<class name="SystemUser" entity-name="SysUser" table="SYS_DEF_USER" abstract="true">
<id name="Id" column="id" type="Int32">
<generator class="identity"/>
</id>
<many-to-one entity-name="SysUserTypes" name="UserTypeId" column="UserTypeId" not-null="true" cascade="none" />
<property name="IsActive" column="IsActive" type="Boolean" not-null="true"/>
<property name="IsLicensed" column="IsLicensed" type="Boolean" not-null="true"/>
<property name="DisplayName" type="string" not-null="false">
<column name="DisplayName" length="128"/>
</property>
<property name="Email" column="Email" type="string" not-null="true" length="200"/>
<property name="PasswordMD5HexHash" column="PasswordMD5HexHash" type="string" not-null="false"/>
<bag name="UserTypeList" inverse="true">
<key column="UserTypeId"/>
<one-to-many entity-name="SysUserTypes"/>
</bag>
</class>
</hibernate-mapping>
我想使用这个查询得到结果
select * from sys_def_user where id not in (select UserId from SYS_DEF_GROUP_MEMBERS where GroupID =5)
什么是休眠语法呢?请尽快...