私の流暢なマッピングは次のとおりです。
HasOne(x => x.User).ForeignKey("fOM_User_Id").Cascade.None();
私のクラスは:
public class OrganizationMember
{
public virtual int MemberId
{
get;
set;
}
public virtual int OrganizationId
{
get;
set;
}
public virtual int UserId
{
get;
set;
}
public virtual User User { get; set; }
public virtual string Permissions
{
get;
set;
}
public virtual System.DateTime DateAdded
{
get;
set;
}
}
クエリを実行します。
var assignableusers = _session.Query<OrganizationMember>().Where(x => x.OrganizationId == CurrentProject.OwnerID)
.Select(x => x.User.Login);
生成されたもの:
select user1_.fU_Login as col_0_0_ from tOrganization_Members organizati0_
left outer join tUsers user1_ on **organizati0_.fOM_Id**=user1_.fU_UserID
where organizati0_.fOM_Organization_Id=7
しかし、それは次のようになっているはずです:
select user1_.fU_Login as col_0_0_ from tOrganization_Members organizati0_
left outer join tUsers user1_ on **organizati0_.fOM_User_Id** = user1_.fU_UserID
where organizati0_.fOM_Organization_Id = 7
マッピングでこれを修正するにはどうすればよいですか? organizati0_.fOM_Idからorganizati0_.fOM_User_Idへ