We're updating the issue view to help you get more done. 

Stream-based querying

Description

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.:

  • where

  • join

  • select

  • groupBy

  • orderBy

That would take a Predicate as parameter (or other suitable functional interface) allowing to construct queries in a form:

1 session.createQuery(Event.class).where(e -> e.getType().equals("Java 8")).orderBy(e -> e.createDate())

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.

Environment

None

Status

Assignee

Unassigned

Reporter

Jakub Narloch

Fix versions

Labels

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Priority

Major