I use Nhibernate with fluency. Now I want to call some stored procedure and use named queries. I created some xml:
<?xml version="1.0" encoding="utf-8"?> <hibernate-mapping> <sql-query name="CleanAppendicesHierarchies"> exec intf_CleanUpAppendixHierarchy </sql-query> </hibernate-mapping>
FluentConfiguration cfg = Fluently.Configure().Database(MsSqlConfiguration.MsSql2005.ConnectionString( c => c.Is(dbConnectionString)).ShowSql()) .Mappings(m => m.FluentMappings.AddFromAssembly(mappingAssembly)) .Mappings(m => m.HbmMappings.AddFromAssembly(mappingAssembly));
Now I always have an Exception: (the innermost exception) {"hibernate-mapping xmlns = '' was not expected." } {"There is an error (1, 2) in the XML document." }
I was messing around, but if I remove hibernate-mapping, it complains about the sql-query tag.
What is wrong with my approach? I googled already found examples, but of course with Fluent ....
Any hint is appreciated
source share