You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by "Andrew Lindesay (JIRA)" <ji...@apache.org> on 2010/01/29 19:48:34 UTC
[jira] Commented: (CAY-1380) Support for Escaped LIKE Clauses in
Expressions
[ https://issues.apache.org/jira/browse/CAY-1380?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12806430#action_12806430 ]
Andrew Lindesay commented on CAY-1380:
--------------------------------------
It seems that some databases have tighter restrictions on where this escape can go; hold off on applying this patch until I can resolve that.
> Support for Escaped LIKE Clauses in Expressions
> -----------------------------------------------
>
> Key: CAY-1380
> URL: https://issues.apache.org/jira/browse/CAY-1380
> Project: Cayenne
> Issue Type: New Feature
> Affects Versions: 3.1M1
> Reporter: Andrew Lindesay
> Attachments: patch-for-like-escaping-29jan2010.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 patch
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.