my2iu / Jinq

LINQ-style queries for Java 8
Other
659 stars 71 forks source link

Question... How does Jinq guesses the operators in Lambdas #101

Closed bsbodden closed 2 years ago

bsbodden commented 2 years ago

This is just curiosity... How does the Lambda analyser parses a lambda like:

JinqStream<Integer> customers = streams.streamAll(em, Customer.class)
   .select(c -> c.getDebt() + c.getSalary() * 2);

How does it extract the + and * from the SerializedLambda? To get "SELECT A.debt + A.salary * 2 FROM Customer A"?

Thanks for any insights... Great library!

my2iu commented 2 years ago

Here’s a video where I walk through the translation of a simple query

https://www.youtube.com/watch?v=JqCnZFzTR2I