[
https://issues.apache.org/jira/browse/CAY-1177?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Loiko Dima updated CAY-1177:
----------------------------
Attachment: FilterObjects_1.txt
> 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.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.