0
我春天和休眠項目,我配置審計表和其工作正常,但我的問題是我想避免在創建新記錄時審覈,但在做更新時應該我下面的代碼如何避免不必要的審計使用休眠envers
實體審計:
@Entity
@Table(name = "building")
@Audited
public class BuildingClass extends CommonTableFields {
@Id
@GeneratedValue(strategy = GenerationType.IDENTITY)
@Column(name = "BID")
@JsonProperty
private long id;
@JsonProperty
private String username;
@JsonProperty
private double count;
//getters and setters
}
實現: //這裏我不想審覈
@Override
public void save(BuildingClass buildingclass) {
repo.save(buildingclass)
}
//這裏我要審覈
@Override
public void update(BuildingClass buildingclass) {
repo.save(buildingclass)
}
在此先感謝
請參閱https://stackoverflow.com/questions/12800540/hibernate-envers-how-to-store-only-updated-values – Sudhakar