Does anyone have a workaround for this issue: https://hibernate.atlassian.net/browse/HHH-9663?
I am also facing a similar issue. When I created one-sided (no reverse reference) one to one relationship between two entities and set the orphan removal attribute to true, the referenced object is still in the database after setting the reference to null.
Here is the sample domain model:
@Entity
public class Parent {
...
@OneToOne(fetch = FetchType.LAZY, cascade = CascadeType.ALL, orphanRemoval = true)
@JoinColumn(name = "child_id")
private Child child;
...
}
@Entity
public class Child {
...
@Lob
private byte[] data;
...
}
I am currently working around this by manually deleting orphans.
See Question&Answers more detail:os