@NotFound(action = NotFoundAction.IGNORE) how to return null not EntityNotFoundException

I use MySQL and don’t have database foreign keys. I know that @NotFound(action = NotFoundAction.IGNORE) will cause lazy failure and the accidental deletion of associated data is also a design irregularity, but I can’t change it. I want to know how to ensure lazy and return null instead of throwing EntityNotFoundException if the associated data cannot be found. Thanks.

hibernate 5.4.30.Final
springboot 2.3.10.RELEASE

spring data jpa 2.3.9 .RELEASE

Citing my answer from the chat:

that’s not possible. you will have either lazy loading and exceptions or eager loading and null , though with bytecode enhancement you can defer the eager loading until you actually access the field/property