agrestio / agrest

Server-side Java REST Framework for easy access to data graphs from various backends
https://agrest.io
Apache License 2.0
80 stars 34 forks source link

AgRest own full-featured expression parser #582

Closed stariy95 closed 1 year ago

stariy95 commented 1 year ago

The last part that is still require Cayenne is complex expressions. To fully decouple everything we should implement own full-featured parser. It still could be based on the Cayenne grammar for the max compatibility.

There's already a working prototype with Cayenne backend switched to the new Expressions in the 5.x-expressions branch. This implementation deprecates old code in the io.agrest.exp package and introduces io.agrest.exp.parser.

Grammar file is here: https://github.com/agrestio/agrest/blob/5.x-expressions/agrest-engine/src/main/jjtree/io/agrest/exp/parser/AgExpressionParser.jjt

andrus commented 1 year ago

5.x-expressions branch looks great. The approach is the best I can think of. Once we merge it, we can decide how much of the deprecated API we need to keep. For now a few comments: