Nice! Thanks! -Glenn
-----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Kelly Stuard Sent: 18. januar 2011 23:45 To: nhusers Subject: [nhusers] Re: LINQ.Any creates too many parentheses for Oracle. NHibernate bug? This seems to have been fixed in trunk as of two days ago: http://216.121.112.228/browse/NH-2280 I just ran into it with 3.0.0 final and am moving to trunk, tonight. On Jan 18, 3:41 am, Glenn <[email protected]> wrote: > I'm using NHibernate 3.0 LINQ against an Oracle 11g R2 and wanted to > use the .Any statement in LINQ > > from p in session.Query<Project>() > where p.Personprojects.Any(pp => pp.Id.PersonId == userId) > select p > > (pp.Id is a composite ID with PersonId and ProjectId) > > This creates the following SQL: > > select > project0_.PROJECT_ID as PROJECT1_92_, > (... lots of properties snipped...), > project0_.VALIDTODATE as VALIDTO25_92_ from PROJECT project0_ where > exists ( select > ( > personproj1_.PROJECT_ID, > personproj1_.PERSON_ID) > > from PERSONPROJECT personproj1_ > where project0_.PROJECT_ID=personproj1_.PROJECT_ID and > personproj1_.PERSON_ID=4042 /* :p0 */) > > Oracle complains with "ORA-00907: missing right parenthesis" > > I narrowed it down to the parentheses in the second select: > > select > ( > personproj1_.PROJECT_ID, > personproj1_.PERSON_ID) > > If I remove those the query works fine. > > Oracle doesn't like parentheses around column names in it's select. A > simple > > select (PROJECT_ID, PERSON_ID) > from PERSONPROJECT > > will also fail. > > Is this an NHibernate bug or am I doing something stupid? If I wanted > to change this behavior in NHibernate and make a patch, do you have > any pointers to where in the NHibernate source I should start? -- 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. -- 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.
