Add soft-delete module: @SoftDelete (DELETED/ACTIVE/TIMESTAMP) vs @SQLDelete + @SQLRestriction on Hibernate 7.4.14.Final, H2 and PostgreSQL 17
Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_017ic4b7rnC7jppGGdHGESvy
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
package com.ankurm.softdelete;
|
||||
|
||||
import jakarta.persistence.*;
|
||||
import org.hibernate.annotations.SoftDelete;
|
||||
import org.hibernate.type.YesNoConverter;
|
||||
|
||||
/** Legacy-schema flavour: column {@code is_gone char(1)} holding 'Y' / 'N', via the {@code converter} attribute. */
|
||||
@Entity
|
||||
@Table(name = "article_yes_no")
|
||||
@SoftDelete(columnName = "is_gone", converter = YesNoConverter.class, comment = "Y = deleted")
|
||||
public class ArticleYesNo {
|
||||
@Id @GeneratedValue(strategy = GenerationType.IDENTITY)
|
||||
private Long id;
|
||||
private String title;
|
||||
|
||||
protected ArticleYesNo() {}
|
||||
public ArticleYesNo(String title) { this.title = title; }
|
||||
|
||||
public Long getId() { return id; }
|
||||
}
|
||||
Reference in New Issue
Block a user