Hibernate proxy properties are null sometimes

I have Contract class like this:

It contains references, for example, to User and some ReportData. Both are simple ManyToOne relations to other tables, in database they are simple foreign keys.

I’m trying to get contract by id:

Contract contract = contractRepository.findById(1L).get();

(I use Spring Data JPA).

I get user and zreport properties: they are hibernate proxies. But sometimes properties of this proxies are null. I read on other forums and StackOverflow that it can be if underlying hibernate session is closed at this moment and hibernate can’t load new requested data.

I can call Hibernate.unproxy method on that property - and it works, but manually everywhere call this method - I think it is a wrong approach.

Also I can use @NamedEntityGraph annotation, and describe in it what I need exactly. For example,

@NamedEntityGraph(name = "curatorAndReport", attributeNodes = {

And in my Repository class:

    @EntityGraph(value = "curatorAndReport")
    @Query("select c from Contract c where c.id = :id")
    fun findByIdWithCuratorAndReport(id: Long): Contract

(it’s Kotlin)

This approach works, but it is too much hard to write and support entity graph for every case that I need to get data. Is there way to tell hibernate force load referenced entities, and open again session and load data in my lazy properties? Like in Hibernate.unproxy, but without additional actions from me.