sql server - Should NHibernate generate SQL for GUID parameter without quotes? -


SQL Server 2008 R2 Express NHibernate 2.1.2.4.

I get the same as SQL:

  select customer0_.Id as ID1_0_ Customers from customer0_ WHERE customer0_.Id=@p0; @ P0 = 11111111-1111-1111-1111-111111111111  

... which gives 0 records even if the customer is with that ID.

SQL

  & lt; Property name = "connection.provider"  

& lt; Session-> NHibernate.Connection.DriverConnectionProvider & lt; / Property & gt; & Lt; Property Name = "connection.driver_class" & gt; NHibernate.Driver.SqlClientDriver & lt; / Property & gt; & Lt; Property Name = "Bid" & gt; NHibernate.Dialect.MsSql2005Dialect & lt; / Property & gt;

Class & lt; Id & gt; Configured

  & lt; Id name = "_ id" column = "id" type = "guide" access = "region" not saved-value = "00000000-0000-0000-0000-000000000000" & gt; & Lt; Generator class = "guid.comb" /> & Lt; / Id & gt;  

The first time is making your way through this, w / help of various tuts. I'm all over but there is no happiness. Any ideas which are wrong / missing here? TYIA!

It looks correct "We should remember that a grid is a string Not even, even thought how we see them. A guitar is a 16-byte data structure. " So I'm not sure that you are not returning the results you expect, but I think the generated SQL is not right.


Comments