I have an entity A
and B extends A
and try to have a soft-delete with joined inheritance strategy.
@Entity
@Inheritance(strategy = InheritanceType.JOINED)
@SQLDelete("UPDATE A SET deleted = 1 WHERE id = ?")
A {
@Id long id;
boolean deleted;
}
@Entity
B extends A {}
It seems that Hibernate properly sets the table A
to deleted = 1
, but also deletes the whole entry from table B
. I would, of course, like to preserve this entry.
Any ideas on that?
I'm using Hibernate 3.5.5 and annotation-based entity definition. Tried Hibernate 3.6.2 as well.