You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by "Øyvind Harboe (JIRA)" <ji...@apache.org> on 2009/07/15 13:37:16 UTC
[jira] Commented: (CAY-1177) Outer join syntax causes exception
with Expression.filterObjects()
[ https://issues.apache.org/jira/browse/CAY-1177?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12731398#action_12731398 ]
Øyvind Harboe commented on CAY-1177:
------------------------------------
Is the FilterObject 1.1.txt ready to be committed?
I had to add a similar(but much cruder) workaround.
> Outer join syntax causes exception with Expression.filterObjects()
> ------------------------------------------------------------------
>
> Key: CAY-1177
> URL: https://issues.apache.org/jira/browse/CAY-1177
> Project: Cayenne
> Issue Type: Bug
> Components: Cayenne Core Library
> Affects Versions: 3.0M5
> Reporter: Øyvind Harboe
> Attachments: FilterObjects.txt, FilterObjects_1.1.txt, FilterObjects_1.txt
>
>
> If the "+." syntax is used in an Expression.filterObjects() it causes an exception. Below is a modification to CayenneDataObject.readNestedProperty() that seems to work around the problem.
> Simply replace "+." with "."
> public Object readNestedProperty(String path) {
> Object object = null;
> CayenneDataObject dataObject = this;
>
> /* convert +. outer join syntax into . */
> if (path.contains("+."))
> {
> path=path.replaceAll("\\+\\.", ".");
> }
>
> String[] tokenized = tokenizePath(path);
> int length = tokenized.length;
> int pathIndex = 0;
> for (int i = 0; i < length; i++) {
> pathIndex += tokenized[i].length() + 1;
> object = dataObject.readSimpleProperty(tokenized[i]);
> if (object == null) {
> return null;
> }
> else if (object instanceof CayenneDataObject) {
> dataObject = (CayenneDataObject) object;
> }
> else if (i + 1 < length) {
> // read the rest of the path via introspection
> return PropertyUtils.getProperty(object, path.substring(pathIndex));
> }
> }
> return object;
> }
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.