For rewriting, try this: https://gist.github.com/gliljas/c638d339bce6d48840d3db09cbf2cbac
You will have to replace all calls to Session.Query with Session.GetQuery (or whatever you want to call it). Maybe you have already created such an extension to redirect Session.Linq<T> to Session.Query<T> 2016-04-19 22:41 GMT+02:00 Oskar Berggren <[email protected]>: > > > 2016-04-19 9:52 GMT+01:00 Erik H <[email protected]>: > >> So I just did a test... >> >> An equals operator in the where statement *does* work! >> >> .Where(ai => ai.AsapVerwerkingsPeriode* == *periodeVanaf >>> && ai.AsapVerwerkingsPeriode* == *periodeTm && ( //niet geblokkeerde >>> beschikbaarstellingen en premie inhoudingen >>> (ai.Type == AsapInputType.Beschikbaarstelling || >>> ai.Type == AsapInputType.BrutoPremieInhouding || ai.Type == >>> AsapInputType.NettoPremieInhouding) && >>> ai.Uitkeringscomponent.Bron != >>> UitkeringscomponentBron.HandmatigplanUC)); >> >> >>> .Where(ai => ai.Uitkeringsplan.Contractnummer == >>> contract || ai.Uitkeringsplan.Contractnummer == contract.PadLeft(20, '0')); >> >> >> Results in: >> >>> where (asapinput0_.AsapVerwerkingsPeriodeMaand = @p0 and >>> asapinput0_.AsapVerwerkingsPeriodeJaar = @p1) and >>> (asapinput0_.AsapVerwerkingsPeriodeMaand = @p2 and >>> asapinput0_.AsapVerwerkingsPeriodeJaar = @p3) and (asapinput0_.Type=@p4 or >>> asapinput0_.Type=@p5 or asapinput0_.Type=@p6) and uitkerings1_.Bron<>@p7 >>> and (uitkerings2_.Contractnummer=@p8 or uitkerings2_.Contractnummer=@p9) >> >> >> >> Why is the *>=* is being translated in SQL to *ge*.... ? The fact stays >> the same that NHibernate creates an incorrect SQL Server Query. Is this >> worth reporting a bug? >> > > The only bug here is that NH fails to throw an immediate and more helpful > exception. Instead of generating flawed SQL, in an ideal world it should > throw something like "attempt to use undefined comparison operator for > multi-column user type" or similar. > > Then conceivably one could also consider having a feature request for > allowing the developer to provide an implementation for SQL, in a way that > would work for both LINQ, HQL and Criteria. Not sure if anything already > exists for that. > > /Oskar > > > -- > 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. > -- 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.
