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:
Actually there is no reason to change current behavior. In fact most NoSql databases ha no concept of referential integrity. Thus it will be a task of the user to update both references, in order to keep data consistent.
In consequence, we will close the issue as "Won't Fix",
Before closing the issue as Won't fix maybe we can add this test.
When dealing with bi-directional association is important that the user applies operations on both side of the association