We have a class with a one to many relationship declared like this (1 or more objects of the same class are linked into the relationship, no circular referencing):
@Entity public class ObjectNode implements Serializable { private static final long serialVersionUID = 1L; @Id public String uUid; ... @OneToMany(fetch=FetchType.LAZY) public Set<ObjectNode> workflow = new HashSet<ObjectNode>();
When we remove an object that is in this relationship (workflow), the object stays in the relationship with all fields set to null except the primary key. The same behavior is when we
- delete with a query
- use entityManager.remove