Jugen commented on code in PR #605:
URL: https://github.com/apache/cayenne/pull/605#discussion_r1485959529
##########
cayenne/src/main/java/org/apache/cayenne/access/translator/select/OrderingStage.java:
##########
@@ -71,4 +85,26 @@ private void processOrdering(QualifierTranslator
qualifierTranslator, Translator
context.getSelectBuilder().orderBy(orderingNodeBuilder);
}
+ private Optional<Node> getResultColumn(TranslatorContext context,
OrderingNodeBuilder orderBuilder) {
+ String orderStr = getSqlString(orderBuilder);
+
+ return context.getResultNodeList().stream()
+ .map(result -> result.getNode())
+ // the column may have an alias so just check that the
orderStr part matches
+ .filter(resultNode ->
getSqlString(node(resultNode)).startsWith(orderStr))
+ .findFirst();
Review Comment:
I thought it's a bit heavy as well. Will need guidance later .....
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]