RE: Parameterized LIKE expressions ...

From: Gentry, Michael \(Contractor\) ("Gentry,)
Date: Thu Mar 09 2006 - 09:37:42 EST

  • Next message: Andrus Adamchik: "Re: incubator status page"

    Well, I'm in the middle of a long-running political fire drill (I *so*
    wish I had a fire hat), but thanks for the pointer. When I get a
    chance, I'll try to take a serious look at it.

    /dev/mrg

    -----Original Message-----
    From: Andrus Adamchik [mailto:andru..bjectstyle.org]
    Sent: Tuesday, March 07, 2006 2:14 AM
    To: cayenne-deve..bjectstyle.org
    Subject: Re: Parameterized LIKE expressions ...

    IIRC I just didn't have time to deal with extending the parser to
    deal with non-atomic literal. If you want to take a shot at it, the
    JavaCC parser is located under exp/parser/ExpressionParser.jjt.
    Running "ant jjtree" will update the generated Java classes to match
    your latest grammar.

    Andrus

    On Mar 7, 2006, at 12:01 AM, Gentry, Michael ((Contractor)) wrote:

    > I know I've asked about this a long time before, but I can't recall
    > the
    > responses.
    >
    > Should a LIKE expression be allowed to have parameterized expressions?
    > For example:
    >
    > Expression expr = Expression.fromString("name like '$name%'");
    >
    > Instead of:
    >
    > Expression expr = Expression.fromString("name like '" + name + "%'");
    >
    > In my SQL logs for the former, I see:
    >
    > LIKE ? [bind: '$name%']
    >
    > Not quite what I was trying to accomplish. Of course, you then
    > need to
    > consider the issue of the user entering the % sign as part of the
    > text.
    > Anyway, If we should allow this, maybe I'll looking into the code
    > when I
    > get a chance.
    >
    > Thanks,
    >
    > /dev/mrg
    >



    This archive was generated by hypermail 2.0.0 : Thu Mar 09 2006 - 09:37:44 EST