why the lazy collection is loaded
<p>I have a Project entity with a oneToMany relationship with Event entity</p>

<pre><code>public class Project {
   ....

   @OneToMany(mappedBy = "dossier", fetch = FetchType.LAZY, cascade = CascadeType.ALL, orphanRemoval = true)
   private List&lt;Event&gt; events;

}
</code></pre>

<p>I have a ProjectService class</p>

<pre><code>@Service
@Transactional
public class ProjectService {

    public List&lt;Project&gt; findAll() {
        return (List&lt;Project&gt;) projectRepository.findAll();
    }
}
</code></pre>

<p>And a ProjectController</p>

<pre><code>@RestController
@RequestMapping(value = "/projects")
public class ProjectController {

    @RequestMapping(method= RequestMethod.GET)
    public List&lt;Project&gt; getAllProject() {
        return projectService.findAll();
    }
}
</code></pre>

<p>In my client code I saw that the events of the projects are loaded and I don't understand why. </p>

<p>I expected that at the end of the transaction of the method findAll in DossierService, the entities will be detached. Obviously my entities are still attached as the events are retrieved during the jackson serialization in my controller.</p>