Fluentnhibernate로 인터페이스 및 콘크리트 클래스를 매핑하려고합니다. 여기 FluentNHibernate로 인터페이스 및 콘크리트 클래스 매핑하기
public interface IUser
{
int Id { get; set; }
}
public class User: IUser
{
public int Id { get; set; }
public string Name { get; set; }
public string Password { get; set; }
}
내 매핑 파일입니다 : 여기
내 인터페이스/클래스의
public class IUserMap: ClassMap
{
public IUserMap()
{
Table("User");
Id(u => u.Id)
.Column("Id")
.GeneratedBy.Native();
}
}
public class UserMap: SubclassMap
{
public UserMap()
{
Map(u => u.Name);
Map(u => u.Password);
}
}
나는이 오류 얻을 :
could not execute query [ SELECT this_.Object_id as Id3_0_, this_.Name as Name4_0_, this_.Password as Password4_0_ FROM "User" this_ inner join User this_1_ on this_.Object_id=this_1_.Id WHERE this_.Name = @p0 ] Positional parameters: #0>test [SQL: SELECT this_.Object_id as Id3_0_, this_.Name as Name4_0_, this_.Password as Password4_0_ FROM "User" this_ inner join User this_1_ on this_.Object_id=this_1_.Id WHERE this_.Name = @p0]
...
통지를 "this_.Object_id"열은 그 것이다. for ... 내 ID 열이 아니지만 Id ("my_id_column")를 지정할 수 없습니다. SubclassMap에서
내가 뭘 잘못하고 있니?
내 자식 SubclassMap에 KeyColumn ("Id")을 추가하면이 작동합니다. object_id 문제 티켓도 열어 둡니다. 감사합니다. 제임스! –