Currently, JPAStreamer is unable to optimize a pipeline that persists DB entities. The example below generates an update query for each Film entity that passes the filter. Optimally, JPAStreamer would render this to a single HQL UPDATE.
@Transactional
public void updateDescription(String desc, short length) {
jpaStreamer.stream(Film.class)
.filter(Film$.length.greaterThan(length))
.forEach(f -> {
f.setDescription(desc);
persist(f);
});
}
Currently, JPAStreamer is unable to optimize a pipeline that persists DB entities. The example below generates an update query for each Film entity that passes the filter. Optimally, JPAStreamer would render this to a single HQL UPDATE.