Despite how crazy this idea sounds, there is an existing project that was the inspiration behind this: Linq Method Query Syntax
The idea would be simple on the API level, define the set of methods i.e.:
That would take a Predicate as parameter (or other suitable functional interface) allowing to construct queries in a form:
While this clearly introduces completly new syntax for creating queries next to existing HQL, criteria API and QBE it might be wort considering it.
The implementation definetly won't be trivial, but probably can be based on already widely used ASM that would have to be used to do the reverse enginering of the lambda statements.
Giovanni, that would be awesome. It would have to live on top of 6.x
codebase which is unfortunately not yet compiling.
On Tue, Aug 29, 2017, 3:32 AM Giovanni Lovato (JIRA) <
This is very interesting. I'm working on implementations of Java 8 Stream, Predicate, Function,
Comparator and Collector which translates to Criteria API. That is:
I'd love to see this in ORM, and I'd love to share and contribute if of any interest!
Also this is not so much "lambda queries". It is stream-based querying.
Tentatively scheduled for 6.0. It will definitely have to wait for 6.x
Broke out and slated as a New Feature. This is not something I plan on tackling any time soon. Maybe with 6.x after the redesign of querying in general.
, if you are interested in pursuing this contact us on the dev mailing list and we can discuss including this in the SQM work.