Bidirectional relationship with @NotNull fails to save

Description

After upgrading from 5.4.16 to 5.4.17 we had several unit tests failing in one of our projects.
I did some investigation and came up with a minimum scenario and test case that reproduces the problem:

And a test case:

With 5.4.16 the following statements are executed and the test completes successfully

With 5.4.17 the result is

If the @NotNulll annotation is removed the entities are saved without any problem, only in a different order

  1. It seems to be related with the fix provided by

  •  

Environment

H2 Database in MySQL mode was used for the test

Assignee

Andrea Boriero

Reporter

Eduardo Simioni

Fix versions

Labels

None

backPortable

None

Suitable for new contributors

None

Requires Release Note

None

Pull Request

None

backportDecision

None

Worked in

5.4.16

Components

Affects versions

Priority

Major
Configure