We're updating the issue view to help you get more done. 

Join columns might keep reference to some previously associated, but then deleted, entities

Description

In case of @OneToMany bidirectional associations, without any definitions of cascade. When we delete the entity owner, it might happen that the associates entities would still keep the reference to the, now deleted, entity owner.
Thus, if we try to create another entity owner, recycling the id owned by the former, we could have associations, between the latter and associated entities, never defined by the user.

This seems affect only grid and document dialects, such as MongoDB or Infinispan. On the other hand, graph dialects, like Neo4j, have no issue. Probabily because the latters do not need to handle the inverses of bidirectional associations.
Test case:

Environment

None

Status

Assignee

Fabio Massimo Ercoli

Reporter

Fabio Massimo Ercoli

Labels

None

Worked in

None

Feedback Requested

None

Feedback Requested By

None

backPortable

None

Community Help Wanted

None

Suitable for new contributors

None

Requires Release Note

None

backportDecision

None

backportReEvaluate

None

Components

Fix versions

Affects versions

5.4.0.Beta2

Priority

Major