Thank you for all your work and help on this.
On Aug 21, 3:19 pm, armin-landscheidt <[email protected]> wrote: > Puhhh some minutes more then i thought ^^. I think I've found it. Ther ist no > lower call for Parameter. > I hope sending fils on groups works. > Here is the Patch for the LikeExpression. But I don't know if it was intended > that ther is no lower call. > I will try to send the patch in a short time to JIRA. > > > > > It matters on Oracle database: > > > select 'X' from dual where lower('ABCDE') like 'A%' > > > Does not return a row, the like comparison fails. > > > On Aug 21, 2:31 pm, armin-landscheidt <[email protected]> wrote: > > >> If I remember right, it doesn't matter if you write 'C%' or 'c%' but I > >> will check it. > > >>> Based on your tests for NH-1902, then this test should pass, too. > > >>> I can't seem to get NHibernate to build and test on my machine. Is > >>> this something you can run?? > > >>> [Test] > >>> public void > >>> TestEnableLikeAndCaseInsensitiveWithMatchmodeAnywhere() > >>> { > >>> using (ISession s = OpenSession()) > >>> using (ITransaction t = s.BeginTransaction()) { > >>> Componentizable master = GetMaster("BERN", > >>> null, null); > >>> ICriteria crit = > >>> s.CreateCriteria(typeof(Componentizable)); > >>> Example ex = Example.Create(master).EnableLike > >>> (MatchMode.Anywhere).IgnoreCase(); > >>> crit.Add(ex); > >>> IList result = crit.List(); > >>> Assert.IsNotNull(result); > >>> Assert.AreEqual(3, result.Count); > >>> t.Commit(); > >>> } > >>> } > > >>> On Aug 21, 11:52 am, Joe <[email protected]> wrote: > > >>>> Oops, I celebrated too soon! > >>>> I grabbed the latest build from NH TeamCity and at first it seemed > >>>> fixed. > > >>>> But, there is a problem still with case. > > >>>> If I set a string property to "C", the parameter generated is "C%", > >>>> but it should be "c%" because the where clause is: "WHERE (lower > >>>> (this_.description) like ?)" > > >>>> "C%" is not going to match anything returned by a lower() function. > > >>>> Armin, did you have this problem?? > > >>>> On Aug 21, 10:26 am, Joe <[email protected]> wrote: > > >>>>> Thanks you guys, I was pulling my hair out! > > >>>>> On Aug 21, 4:15 am, Armin Landscheidt <[email protected]> wrote: > > >>>>>>http://nhjira.koah.net/browse/NH-1902 > > >>>>>> On Aug 21, 1:02 pm, Saijado <[email protected]> wrote: > > >>>>>>> This Bug should be fixed in Version 2.1.1 I've send a patch to JIRA > >>>>>>> some weeks ago. Search in JIRA for "Example" and you should find my > >>>>>>> post. > > >>>>>>> -- Armin > > > > [lowercaseMissingOnParameters.patch1K ]Index: LikeExpression.cs > =================================================================== > --- LikeExpression.cs (revision 4656) > +++ LikeExpression.cs (working copy) > @@ -69,12 +69,21 @@ > .Add(StringHelper.OpenParen) > .Add(columns[0]) > .Add(StringHelper.ClosedParen); > + > + > + lhs.Add(" like > ").Add(dialect.LowercaseFunction) > + .Add(StringHelper.OpenParen) > + .AddParameter() > + .Add(StringHelper.ClosedParen); > + > } > - else > + else { > lhs.Add(columns[0]); > + lhs.Add(" like ").AddParameter(); > + > + } > > > criteriaQuery.AddUsedTypedValues(GetTypedValues(criteria, criteriaQuery)); > - lhs.Add(" like ").AddParameter(); > if (escapeChar.HasValue) > lhs.Add(" escape '" + escapeChar + "'"); > return lhs.ToSqlString(); --~--~---------~--~----~------------~-------~--~----~ 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 -~----------~----~----~----~------~----~------~--~---
