Re: [hibernate-dev] Making APIs more Lambda-friendly

2016-03-01 Thread Gunnar Morling
ResultTransformer wouldn't even be needed anymore eventually. There could be an adapter class of sorts internally which aggregates both methods if that simplifies handling internally, but it's not needed per se. 2016-03-01 13:37 GMT+01:00 Vlad Mihalcea : > Good idea. > > So, ResultTranformer will

Re: [hibernate-dev] Making APIs more Lambda-friendly

2016-03-01 Thread Vlad Mihalcea
Good idea. So, ResultTranformer will extend both the ResultRowTransformer and ResultListTransformer so it will inherit both methods. Actually, the `transformList(List list)` is only needed by `DistinctResultTransformer`, so most of the time we'd only have to pass `ResultRowTransformer`. Vlad On

[hibernate-dev] Making APIs more Lambda-friendly

2016-03-01 Thread Gunnar Morling
Hi, Tinkering with result transformers, I wished I'd be able to express a tuple transformation like this, using Java 8 Lambda-style: session.createQuery( "SELECT foo, bar FROM Baz" ) .transformResultTuples( (tuple, aliases) -> { return tuple[0] + " " + tuple[1]; } ) .list();