I have mapped a named query for a SQL user function like so:

<hibernate-mapping xmlns="urn:nhibernate-mapping-2.2">
    <sql-query name="GetDataTree">
        <return class="MyDataTree" />
        select * from [MyDatabase].[dbo].[ufn_GetDataTree](:entityId)
    </sql-query>
</hibernate-mapping>

I can then use this with the GetNamedQuery() method and this works fine:

List<MyDataTree> myData = session.GetNamedQuery("GetDataTree")
    .SetParameter("entityId", "12345")
    .List<MyDataTree>()
    .ToList();
foreach (MyDataTree d in myData)
{
    Console.WriteLine(d.Id);
}

Now I would like to use this named query in a subquery like so:

select 
     Id,
     Description
from MyOtherEntity
where
     Id in (select Id from ufn_GetDataTree("12345"))

Unfortunately, I can't find any method that will allow me to get my named 
query and use it as a subquery with QueryOver.

Advice is appreciated.

-- 
You received this message because you are subscribed to the Google Groups 
"nhusers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/nhusers.
For more options, visit https://groups.google.com/d/optout.

Reply via email to