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

Expressions - immutable parameter binding, pruning unbound conditions #602

Closed andrus closed 1 year ago

andrus commented 1 year ago

Would be great to be able to reuse parsed expressions with different parameter sets for performance. This should work not only with ExpRoot, but any expression (that would allow expression composition outside the parser).

Exp.positionalParams(Object...) // creates new instance
Exp.namedParams(Map) // creates new instance

Also would be nice to have a Cayenne-like feature, where unbound parameters result in pruning of the whole unbound condition within an expression:

Exp.namedParams(Map params, boolean pruneMissing) // creates new instance