Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017ic4b7rnC7jppGGdHGESvy
16 lines
471 B
Java
16 lines
471 B
Java
package com.ankurm.softdelete;
|
|
|
|
import jakarta.persistence.*;
|
|
import org.hibernate.annotations.SoftDelete;
|
|
import org.hibernate.annotations.SoftDeleteType;
|
|
|
|
/** One place to say "soft delete" for a family of entities. */
|
|
@MappedSuperclass
|
|
@SoftDelete(strategy = SoftDeleteType.TIMESTAMP, columnName = "deleted_at")
|
|
public abstract class SoftBase {
|
|
@Id @GeneratedValue(strategy = GenerationType.IDENTITY)
|
|
private Long id;
|
|
|
|
public Long getId() { return id; }
|
|
}
|