stream on JPA lazy list
<p>I have JPA entity with list like this:</p>

<pre><code>@OneToMany(mappedBy = "scadaElement", orphanRemoval = true)
private List&lt;ElementParameter&gt; elementParameters;
</code></pre>

<p>and map form ElementParameter</p>

<pre><code>@ManyToOne
@JoinColumn(name = "SCADAELEMENT_ID")
ScadaElement scadaElement;
</code></pre>

<p>when i get entity with elementParameters list and do stream on it stream do nothing, even when I trigger list with .size() but when I do the same with a for loop it work.</p>

<pre><code>System.out.println("elements size: " + s.getElementParameters().size());
s.getElementParameters()
            .stream()
            .forEach(
                    a -&gt; { 
                        System.out.println("elementId: " + a.getId());
                    }
            );
</code></pre>

<p>Is there any solution to make that stream work? I use eclipselink as JPA provider.</p>