I have spend 2 days trying to figure it out but without success so i wonder if it is a bug after all..
I am trying to group some data.
If my query is
streams
.streamAll(em, ParastatikaEntity.class)
.where(c -> c.getDate_created().after(from))
.where(c -> c.getDate_created().before(to))
.where(c -> c.getEidos().getTameio_affect() == 1)
.group(c -> c.getSynallassomenos().getName(),(name,stream)-> stream.sumBigDecimal(c -> c.getTotal_no_vat()))
.forEach(pair -> System.out.println(pair.getOne() + " " + pair.getTwo()));
it works fine, if i try to put it on a List with this
List<Pair<String,BigDecimal>> result =
streams
.streamAll(em, ParastatikaEntity.class)
.where(c -> c.getDate_created().after(from))
.where(c -> c.getDate_created().before(to))
.where(c -> c.getEidos().getTameio_affect() == 1)
.group(c -> c.getSynallassomenos().getName(),(name,stream)-> stream.sumBigDecimal(c -> c.getTotal_no_vat()));
i get
incompatible types: no instance(s) of type variable(s) U,V exist so that JPAJinqStream<Pair<U,V>> conforms to List<Pair<String,BigDecimal>>
where U,V,T are type-variables:
U extends Object declared in method <U,V>group(Select<T,U>,AggregateGroup<U,T,V>)
V extends Object declared in method <U,V>group(Select<T,U>,AggregateGroup<U,T,V>)
T extends Object declared in interface JPAJinqStream
Do i miss something here?