I have upgraded my hibernate- core library from 5.4.11.Final to 5.4.18.Final release. During unit testing, I have noticed that in cases where NotNull annotation is used for ManyToOne JPA joins, the expected inner join in the generated query became left outer join. It seems that for 5.4.18.Final release NotNull annotation in for these cases is not operating as expected. Is there any explanation for this?
Note: I have by passed it by removing @NotNull before the @ManyToOne and by applying optional = false.
This was a bug that was fixed some version. If you want the JPA association to be non-optional you must specify optional = false like you seem to have figured out already.
Thank you very much for your response! Could you please specify which was that bug exactly? I need to include this information to the relevant documentation of hibernate upgrade for my code.