Issue
I have a base entity not intended to be audited:
@Data
@MappedSuperclass
@EqualsAndHashCode(of = {"id"})
public abstract class BaseEntity implements Serializable {
@CreationTimestamp
@Temporal(TemporalType.TIMESTAMP)
@Column(name = "created_at", updatable = false, nullable = false)
private Date createdAt;
and there is a subclass like:
@Entity
@Audited
@AuditTable(schema = "audit", value = "bank")
@Table(name = "bank")
public class Bank extends BaseEntity {
@Column(name = "name")
private String name;
so as the final result I get only name
column falls into the audit.bank
audit table, while created_at
isn't. How I can make it being auditable, not breaking the inheritance of entities?
Solution
@AuditOverride(forClass = BaseEntity.class, isAudited = true)
helped me
Answered By - Ilya Yevlampiev
Answer Checked By - Candace Johnson (JavaFixing Volunteer)