{{ Query<R>.stream }} claims to return {{ java.util.stream.Stream<R> }} but seems to always return a stream of Object[], even for queries with single entity results (i.e. created with {{ createQuery("SELECT e FROM EntityType e", EntityType.class) }} that do have a Query<EntityType> type - and where the other typed methods getResultList/iterate produce the expected results.
Using that stream usually results in a ClassCastException: {code} q.stream().forEach(x -> { // we won't even get here as the argument is inferred as EntityType });
{code} |
|