stariy95 opened a new pull request, #597:
URL: https://github.com/apache/cayenne/pull/597
This PR introduces `CayennePath` and `CayennePathSegment` classes (that
should be value objects, but that's still not a thing in Java).
It allows to make any path-related logic more transparent and precise.
There are some minor incompatibilities introduced. They are all just changes
of the return type in several methods from `String` to `CayennePath` (like
`ObjRelationship.getDbRelationshipPath()` method), so shouldn't be a big
problem.
Here are some examples of it's usage:
```java
// 1. concatenate paths
CayennePath key = parentPath == null
? path.dot(entity.getName())
: parentPath.dot(path).dot(entity.getName());
// 2. mark the last path segment as outer join
CayennePathSegment last = getPath().last();
CayennePath outerPath = getPath().parent()
.dot(last.withModifier(CayennePath.OUTER_MODIFIER))
// 3. get tail of the path
CayennePath pathRemainder = path.tail(1);
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: commits-unsubscr...@cayenne.apache.org
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org