I have to join a table TransactionDeclaration(Id,...) with a parametric function fp_Transaction_ACL(userId) which returns (TransactionDeclarationId,AccessRightId). The join must be an inner join.
I have done the following mapping using Fluent NHibernate:
public TransactionDeclarationMap()
{
this.Id(transactionDeclaration => transactionDeclaration.Id);
this.Join(
"fp_TransactionDeclaration_ACL(:AclFilter.userId)",
join =>
{
join.KeyColumn("TransactionDeclarationId");
join.Map(transactionDeclaration => transactionDeclaration.AccessRight, "AccessRightType").CustomType
<AccessRight>().Generated.Always().ReadOnly();
join.Inverse();
join.Fetch.Join();
});
}
Since the function must not be inserted or updated, I have added the 'join.Inverse()' as explained here :
Nhibernate/hibernate Avoid Insert in joined table or view
But when I add this inverse, the join becomes a left outer join which is not ok for my use case. I need an inner join to filter records of the table 'TransactionDeclaration' not returned by the function.
How can I get an inner join ? Or is there an alternative to the 'Inverse' to avoid inserting in the function ?