How can I map a many-to-one relationship where the "one" entity has a composite-id? For example:
public class SingleEntity
{
public int FirstId{get;set;}
public int SecondId{get;set;}
public string SomeData{get;set;}
}
The entity ManyEntity
has (in addition to a primaryKey) columns for both SingleEntity
's FirstId and SecondId, so I want to be able to mape the relationship so that ManyEntity
would look like that:
public class ManyEntity
{
public int Id{get;set;}
public SingleEntity Single{get;set;}
public string Name{get;set;}
}
How can I do it using NHibernate?