cayenne-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Lindesay (JIRA)" <>
Subject [jira] Updated: (CAY-1380) Support for Escaped LIKE Clauses in Expressions
Date Sun, 04 Apr 2010 13:08:27 GMT


Andrew Lindesay updated CAY-1380:

    Attachment: patch-CAY1380.diff

I have back-ported the patch for CAY-1380 to be applied to "STABLE-3.0".  This is now attached
to the ticket CAY-1380.  I have checked my own test-case which doesn't also need CAY-1402
and it appears to work fine.  Can you please check this and then apply to STABLE-3.0 for me.
 I am a little confused by SVN commit #905112 which is related to CAY-1380; I may need you
to back-port this to "STABLE-3.0".

> Support for Escaped LIKE Clauses in Expressions
> -----------------------------------------------
>                 Key: CAY-1380
>                 URL:
>             Project: Cayenne
>          Issue Type: New Feature
>    Affects Versions: 3.1M1
>            Reporter: Andrew Lindesay
>             Fix For: 3.1M1
>         Attachments: CAY1380-patch-31jan2010-1405.diff, patch-CAY1380.diff
> At present in Cayenne, by using Expressions, it is not possible to escape LIKE clauses.
 So if somebody enters FOO%BAR into a client all you can do is to strip out the %.  This is
a bit tricky to work around.  The JDBC approach is allow you to append some extra text to
the operand in order to define an escape character like this;
> SELECT a FROM tabA WHERE a LIKE '%=_' {escape '='}
> So, I added an instance variable to "PatternMatchNode" to carry the escape char and then
modified "QueryAssemblerHelper" to append this to the operand if it is present.  See attached

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message