I'm running into constant performance problems with regards to SQL when 
trying to utilize HierarchyIds because of the query plans not using the 
correct indexes. It all seems to stem from the fact that nHibernate 
uses sp_executesql to execute statements, and passes my parameters 
as nvarchar(4000). I need to get it to correctly indicate that the SQL type 
of my parameter(s) is hierarchyid.

There are a bunch of examples for supporting the hierarchyid data type in 
nhibernate, but they all stop at the bare minimum. (example 
https://github.com/RaveNoX/NHibernate.HierarchyId)

I need to figure out a way to generate/modify the HQL in the call 
to BaseHqlGeneratorForMethod.BuildHql() to indicate that a parameter passed 
to something like BooleanMethodCall() should use the hierarchyid database 
type. From what I've read, HqlIdent is the way to do this, but I'm 
struggling with the innards of NHibernate and the HQL expressions to 
accomplish what I need.

For example, take this implementation to support for the IsDescendantOf() 
method. 
https://github.com/RaveNoX/NHibernate.HierarchyId/blob/master/NHibernate.HierarchyId/Linq/IsDescendantOfGenerator.cs
I need to indicate that the parameter passed should be the hierarchyid when 
it's resolved to sql query.

I'd love it if I could get some pointers in the right direction for this 
one as it's starting to turn into a substantial roadblock for development.

-- 
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 https://groups.google.com/group/nhusers.
For more options, visit https://groups.google.com/d/optout.

Reply via email to