Hibernate @Filter not working on Child with FetchType.LAZY

I am with the following issue: When I execute a query on the parent entity (Contract) applying filters on child (ContractHeader) and using FetchType.LAZY, the LAZY rule is applied correctly, but when i try access the list of child (ContractHeader) the filters are not applied to child and all the children are loaded in the list. Can anyone help me with this question ? Filters should work with fetchtype.LAZY ? Tks !

My Hibernate verson: Hibernate ORM core version 5.4.17.Final

I have the following entities:

@Entity
@Table(name = "contract")
@FilterDefs ({
    @FilterDef(name = "calculatedFilter",       parameters = {@ParamDef(name = "calculated",        type = "java.lang.String"  )}),
    @FilterDef(name = "headerStatusFilter",     parameters = {@ParamDef(name = "headerStatus",      type = "java.lang.String"  )})
})
public class Contract {

    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "contract_id")
    private Long contractId;

    @OneToMany(mappedBy="contract",fetch = FetchType.LAZY, cascade = {CascadeType.ALL}, orphanRemoval=true)
    @Filters( {
        @Filter(name="calculatedFilter",        condition="calculated = :calculated"),
        @Filter(name="headerStatusFilter",      condition="header_status = :headerStatus")
    })
    @JsonManagedReference
    private List<ContractHeader> contractHeader;
}
@Entity
@Table(name = "contract_header")
@JsonIdentityInfo(generator=ObjectIdGenerators.PropertyGenerator.class, property="contractHeaderId", resolver=EntityIdResolver.class, scope = ContractHeader.class)
@Data
public class ContractHeader implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "contract_header_id")
    private Long contractHeaderId;

    @Column(name = "branch")
    private Integer branch;


    @Column(name = "calculated")
    private String calculated;

    @Column(name = "header_status")
    private String headerStatus;

    @ManyToOne(optional=false)
    @JoinColumn(name = "contract_id", updatable=false)
    @JsonBackReference
    private Contract contract;
}    

and before call the query i have enabled the filters:

session.enableFilter(“calculatedFilter”).setParameter(“calculated”, “S”); session.enableFilter(“headerStatusFilter”).setParameter(“headerStatus”, “A”);

The Queries generates:

Before accessing the child:

select
    contract0_.contract_id as contract1_2_
from
    contract contract0_ 
where
    exists (
        select
            contracthe1_.contract_header_id 
        from
            contract_header contracthe1_ 
        where
            contract0_.contract_id=contracthe1_.contract_id 
            and contracthe1_.calculated = ? 
            and contracthe1_.header_status = ?

        )

When accessing the child:

select
    contracthe0_.contract_id as contrac28_6_0_,
    contracthe0_.contract_header_id as contract1_6_0_,
    contracthe0_.contract_header_id as contract1_6_1_,
    contracthe0_.calculated as calculat5_6_1_,
    contracthe0_.header_status as header_6_6_1_
from
    contract_header contracthe0_ 
where
    contracthe0_.contract_id=?

Has anyone implemented something like this successfully?

Recently faced a similar issue, where i had referenced a foreign key while lazy loading the JPA. Just try adding @Transactional annotation in the caller method, which tells the Spring to execute loading of foreign key as a separate transaction, which might fix this issue.