I'm trying to map an interface and concrete class with fluentnhibernate.
here's my interface / class:
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; }
}
here's my mapping files:
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);
}
}
and I get this error:
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]
...
notice the "this_.Object_id" column it's looking for... that's not my ID column, but I can't specify an Id("my_id_column"); in the SubclassMap
what am I doing wrong?