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

Expression parser to support path aliases #657

Closed andrus closed 6 months ago

andrus commented 10 months ago

Paths with aliases (a.b#alias1.c) should be properly parsed and translated to Cayenne expressions. This would allow to build special kinds of expressions:

// "either 5 or 6" (no aliases)
a.b = 5 or a.b = 6

// "both 5 and 6" (will never match anything without aliases)
a.b = 5 and a.b = 6

// "both 5 and 6" (with aliases)
a.b#a1 = 5 and a.b#a2 = 6`

ExpPath after parsing should contain a normalized path without aliases and a map of aliases. When translating to Cayenne, the aliases must be passed over to ASTObjPath