Hibernate and java 8 lambda's
hibernate, java, java-8, lambda
Solution
I thought it could not be done too. But I saw Jinq http://www.jinq.org/ They do it for raw SQL queries.
database.customerStream().where(
customer -> customer.getName().equals("Alice"));
So I think it just depends on someone implement the same kind of logic being used in Jinq for JPA entities, and generate JPQL queries.
UPDATE: They do it for JPA too. http://www.jinq.org/docs/gettingstartedjpa.html
Problem
Since the introduction of Java 8, is Hibernate waiting some changes? specially Is there any way to write queries with lambdas in Hibernate? (i.e. like a .net Linq-to-SQL style) If not, when it's coming (If it's planned to come). for example something like these: ``` User u1 = dbo.Users.firstOrDefault(f -> f.userId = 10); List<User> users = dbo.Users.selectMany(w -> w.userId > 5); ```