I have an abstract base class Athat is @MappedSuperClass. In addition, there are several classes of entities that extend from the class A. The class Acontains an attribute STATUSthat represents the deletion of the record or not.
@MappedSuperclass
public abstract class A {
@Id
private Long id;
@Column(nullable = false)
private boolean status = true;
}
I want to be able to perform soft deletion on all child classes from a class Awith annotation @SQLDelete. For example, I have a class B extends Aand whenever I call delete in the class B, I want it to update the status of this record in the database.
@Entity
@Table(name = "TempTable")
@SQLDelete(sql = "update TempTable set STATUS = 0 where ID = ?")
@Where(clause = "STATUS = 1")
public class B extends A {
private String alpha;
}
, @SQLDelete . A . .
? , ?
.