我正在为我的映射使用流利的 nHibernate,如下所示:
public class ContentTagMap: ClassMap<Employee>
{
public EmployeeMap()
{
Id(t => t.Id);
Map(t => t.Name);
HasManyToMany(t => t.Company);
}
}
public class CompanyMap: ClassMap<Company>
{
public HelpMap()
{
Id(h => h.Id);
Map(h => h.CompanyName).Length(6000);
Map(h => h.address).Length(6000);
HasManyToMany(h => h.Employee);
}
}
这些映射产生 Employee Table 、Company Table 和 EmployeeToCompany Table
员工表
Id Name
1 John
2 MAX
公司表
Id CompanyName address
1 HTC ABC
2 HTC2 India
EmployeeToCompany 表
Employee_Id Company_Id
1 1
2 1
如何删除 ID 为 1 的员工?