I'm discovering nhibernate right now. Thus my question is maybe very stupid :)
What I'm trying to do (I'm working with a legacy database) is to get an entity which some of its data are coming from a table value function. My entity is the following
public class Entity
{
public virtual int Id { get; protected set; }
....
public virtual int AccessRightId { get; set; }
}
where AccessRightId comes from the table value function (fp_AccessRight('userId'))
I have the following mapping
public class EntityMap : ClassMap<Entity>
{
public EntityMap ()
{
this.Id(entity => entity .Id);
this.Join(
"fp_AccessRight('userId')",
join =>
{
join.Fetch.Join();
join.KeyColumn("EntityId");
join.Map(t => t.AccessRightId, "AccessRightType");
join.Table();
});
}
}
Unfortunately, I'm not able to substitute 'userId' by any value. Thanks. Is there a way to do it?