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:
Stream<Foo> fooStream = new CriteriaStream(Foo.class, entityManager);
Stream<Baz> bazStream = fooStream
.filter(Foo_.bar.greaterThan(5))
.sort(Foo_.bar.ascending())
.skip(10)
.limit(20)
.map(Foo_.baz);
I'd love to see this in ORM, and I'd love to share and contribute if of any interest! |