我正在使用休眠环境来审计我的实体。我有这样的OfficeEntity:
@Entity
@Audited
@EntityListeners({AuditingEntityListener.class})
@Table(name = "office")
@AuditTable("office_aud")
public class OfficeEntity extends Auditable{
@Id
@GeneratedValue(strategy = GenerationType.AUTO)
@Column(name = "office_id")
private Long id;
@Column(name = "office_code")
private String officeCode;
@Column(name = "office_name")
private String OfficeName;
//getters & setters & constructor
}
和这样的可审计实体:
@MappedSuperclass
public class Auditable{
@CreatedBy
@Column(name = "created_by")
private String createdBy;
@CreatedDate
@Column(name = "created_date")
private Date createdDate;
@LastModifiedBy
@Column(name = "last_modified_by")
private String lastModifiedBy;
@LastModifiedDate
@Column(name = "last_modified_date")
private Date lastModifiedDate;
//getters & setters & constructor
}
似乎这种结构的审计字段没有填写 office_aud 表。所以有人知道我如何填写 office_aud 表中的审计字段吗?