Hibernate JPA - ManyToOne relationship not populated
Thanks to the suggestions from people here, which are probably relevant, but didn't help my specific case.
If you're reading this experiencing the same problem, it's probably worth trying the max_fetch_depth
suggestion, but for some reason it didn't work for me (I'd love suggestions as to why?).
Likewise, if your @OneToMany
s are Sets, rather than Lists, doing an eager fetch or a left join, as suggested by Albert might work, but apparently Hibernate only lets you have a maximum of 1 List that is eagerly fetched, if you need more than that, your collections should be Sets. I didn't try it, but I suspect that it might have solved the problem.
Unless anyone has a better suggestion, I'll stick with calling refresh, which actually probably makes more sense for my application anyway.