== !addInvoices mean: equals to the negation of addInvoices On Thu, Feb 17, 2011 at 7:57 AM, Yogesh Jagota <[email protected]>wrote:
> I have this query: > > var items = (from b in session.Query<InvoiceDetail>() > where b.Customer == AddressedToCustomer && > b.IsCreditNote == ! > addInvoices > orderby b.DueDate , b.InvoiceNumber > select b).ToList(); > > This query works fine on 3.0.0.1002, but fails on 3.0.0.4000. The > latter version always returns the result as if addInvoices was always > true. > > SQL Generated in 3.0.0.1002: > 2011-02-17 15:55:43,612 DEBUG select invoicedet0_.Id as Id3_, > invoicedet0_.InvoiceNumber as InvoiceN2_3_, > invoicedet0_.DocumentNumber as Document3_3_, invoicedet0_.DocumentDate > as Document4_3_, invoicedet0_.DueDate as DueDate3_, > invoicedet0_.DivisionDetails as Division6_3_, invoicedet0_.IsInvoice > as IsInvoice3_, invoicedet0_.IsCreditNote as IsCredit8_3_, > invoicedet0_.OriginalAmount as Original9_3_, invoicedet0_.Amount as > Amount3_, invoicedet0_.LRNo as LRNo3_, invoicedet0_.LRDate as > LRDate3_, invoicedet0_.DispatchedBy as Dispatc13_3_, > invoicedet0_.CreditDays as CreditDays3_, invoicedet0_.CustomerId as > CustomerId3_ from InvoiceDetails invoicedet0_ where > ((invoicedet0_.CustomerId is null) and (@p0 is null) or > invoicedet0_.CustomerId=@p0) and case when invoicedet0_.IsCreditNote=1 > then 1 else 0 end=case when @p1=1 then 1 else 0 end order by > invoicedet0_.DueDate asc, invoicedet0_.InvoiceNumber asc;@p0 = 101790 > [Type: Int32 (0)], @p1 = False [Type: Int32 (0)] > 2011-02-17 15:55:43,618 DEBUG select invoicedet0_.Id as Id3_, > invoicedet0_.InvoiceNumber as InvoiceN2_3_, > invoicedet0_.DocumentNumber as Document3_3_, invoicedet0_.DocumentDate > as Document4_3_, invoicedet0_.DueDate as DueDate3_, > invoicedet0_.DivisionDetails as Division6_3_, invoicedet0_.IsInvoice > as IsInvoice3_, invoicedet0_.IsCreditNote as IsCredit8_3_, > invoicedet0_.OriginalAmount as Original9_3_, invoicedet0_.Amount as > Amount3_, invoicedet0_.LRNo as LRNo3_, invoicedet0_.LRDate as > LRDate3_, invoicedet0_.DispatchedBy as Dispatc13_3_, > invoicedet0_.CreditDays as CreditDays3_, invoicedet0_.CustomerId as > CustomerId3_ from InvoiceDetails invoicedet0_ where > ((invoicedet0_.CustomerId is null) and (@p0 is null) or > invoicedet0_.CustomerId=@p0) and case when invoicedet0_.IsCreditNote=1 > then 1 else 0 end=case when @p1=1 then 1 else 0 end order by > invoicedet0_.DueDate asc, invoicedet0_.InvoiceNumber asc;@p0 = 101790 > [Type: Int32 (0)], @p1 = True [Type: Int32 (0)] > > SQL Generated in 3.0.0.4000: > 2011-02-17 16:22:15,275 DEBUG select invoicedet0_.Id as Id3_, > invoicedet0_.InvoiceNumber as InvoiceN2_3_, > invoicedet0_.DocumentNumber as Document3_3_, invoicedet0_.DocumentDate > as Document4_3_, invoicedet0_.DueDate as DueDate3_, > invoicedet0_.DivisionDetails as Division6_3_, invoicedet0_.IsInvoice > as IsInvoice3_, invoicedet0_.IsCreditNote as IsCredit8_3_, > invoicedet0_.OriginalAmount as Original9_3_, invoicedet0_.Amount as > Amount3_, invoicedet0_.LRNo as LRNo3_, invoicedet0_.LRDate as > LRDate3_, invoicedet0_.DispatchedBy as Dispatc13_3_, > invoicedet0_.CreditDays as CreditDays3_, invoicedet0_.CustomerId as > CustomerId3_ from InvoiceDetails invoicedet0_ where > invoicedet0_.CustomerId=@p0 and case when invoicedet0_.IsCreditNote=1 > then 'true' else 'false' end=case when @p1='true' then 'true' else > 'false' end order by invoicedet0_.DueDate asc, > invoicedet0_.InvoiceNumber asc;@p0 = 101790 [Type: Int32 (0)], @p1 = > 'False' [Type: String (0)] > 2011-02-17 16:22:15,279 DEBUG select invoicedet0_.Id as Id3_, > invoicedet0_.InvoiceNumber as InvoiceN2_3_, > invoicedet0_.DocumentNumber as Document3_3_, invoicedet0_.DocumentDate > as Document4_3_, invoicedet0_.DueDate as DueDate3_, > invoicedet0_.DivisionDetails as Division6_3_, invoicedet0_.IsInvoice > as IsInvoice3_, invoicedet0_.IsCreditNote as IsCredit8_3_, > invoicedet0_.OriginalAmount as Original9_3_, invoicedet0_.Amount as > Amount3_, invoicedet0_.LRNo as LRNo3_, invoicedet0_.LRDate as > LRDate3_, invoicedet0_.DispatchedBy as Dispatc13_3_, > invoicedet0_.CreditDays as CreditDays3_, invoicedet0_.CustomerId as > CustomerId3_ from InvoiceDetails invoicedet0_ where > invoicedet0_.CustomerId=@p0 and case when invoicedet0_.IsCreditNote=1 > then 'true' else 'false' end=case when @p1='true' then 'true' else > 'false' end order by invoicedet0_.DueDate asc, > invoicedet0_.InvoiceNumber asc;@p0 = 101790 [Type: Int32 (0)], @p1 = > 'True' [Type: String (0)] > > Can somebody help me in this regard. > > Thanks. > > -- > You received this message because you are subscribed to the Google Groups > "nhusers" group. > To post to this group, send email to [email protected]. > To unsubscribe from this group, send email to > [email protected]. > For more options, visit this group at > http://groups.google.com/group/nhusers?hl=en. > > -- Fabio Maulo -- You received this message because you are subscribed to the Google Groups "nhusers" group. To post to this group, send email to [email protected]. To unsubscribe from this group, send email to [email protected]. For more options, visit this group at http://groups.google.com/group/nhusers?hl=en.
