Re: Using an Escaped LIKE Clause

From: Andrus Adamchik (andru..bjectstyle.org)
Date: Thu Jan 28 2010 - 03:54:31 EST

  • Next message: John Armstrong: "Re: Cayenne code generation - pointers requested"

    Hi Andrew,

    By straightforward I meant from a general framework architecture
    standpoint, i.e. no changes to the processing pipeline, just extending
    what we have.

    Yes, a minimal implementation would be adding escape char to
    PatternMatchNode and then tweak the QualifierTranslator to actually
    place it in the SQL. Don't remember if the syntax requires any further
    DbAdapter tweaking for various DBs.

    A full implementation would also include an addition to
    ExpressionParser.jjt to allow escape char in String expressions. This
    can be hopefully copied from EJBQLParser.jjt.

    Cheers,
    Andrus

    On Jan 28, 2010, at 10:40 AM, Andrew Lindesay wrote:

    > Hi Andrus;
    >
    > Thanks for that -- I am fairly new to actually using Cayenne. Are
    > you able to give me any pointers? As a guess I think I would need
    > to add the escape character to "PatternMatchNode" and then modify
    > something around "DataObjectMatchTranslator" or
    > "QualifierTranslator" to turn that into SQL.
    >
    > Regards;
    >
    >> Lachlan is correct. Escaping is only supported in EJBQL now:
    >> SELECT p FROM Painting p WHERE p.paintingTitle LIKE 'X_DDDD' ESCAPE
    >> 'X'
    >> Should be more or less straightforward to add it to Expressions I
    >> guess.
    >
    > ___
    > Andrew Lindesay
    > www.lindesay.co.nz
    >
    >



    This archive was generated by hypermail 2.0.0 : Thu Jan 28 2010 - 03:55:08 EST