views:

27

answers:

1

In the application I'm developing, I am using NHibernate as ORM. My app has to support SQL Server, and MS Access (I'm using the NHibernate JetDriver).

Now, the thing is that I have a certain query which I cannot achieve using HQL or the ICriteria API; so, I'm using an ISQLQuery for that one.

Now, what bothers me, is that it seems that NHibernate is parsing the native SQL query as well, and thereby changing the SQL code of that query. It seems that the specific Driver implementation is called, and my query is parsed; and in the case of the JetDRiver, the query is being modified by NHibernate which results in a query that is unexecutable.

So, why is it that NHibernate changes my native SQL queries ?

+1  A: 

NHibernate does some changes even in native queries in order to be able to map the entities correctly.

My suggestion... download the JetDriver source from https://nhcontrib.svn.sourceforge.net/svnroot/nhcontrib/trunk/src/NHibernate.JetDriver/ and debug to see what's being broken. It might be a bug there.

Diego Mijelshon