You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cayenne.apache.org by "stariy95 (via GitHub)" <gi...@apache.org> on 2023/12/21 09:55:59 UTC
[PR] CAY-2833 Unify code related to the Cayenne model paths processing [cayenne]
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-unsubscribe@cayenne.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] CAY-2833 Unify code related to the Cayenne model paths processing [cayenne]
Posted by "stariy95 (via GitHub)" <gi...@apache.org>.
stariy95 merged PR #597:
URL: https://github.com/apache/cayenne/pull/597
--
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-unsubscribe@cayenne.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org