我有一个如下的POJO
class Employee{
private int id;
private String name;
private String profession;
private int experince;
public Employee(int id, String name, String profession, int experience){
this.id = id;
this.name = name;
this.profession = profession;
this.experience = experience;
}
我有两个要比较的对象
Employee emp1 = new Employee(1, "John Doe", "Architect",10);
Employee emp2 = new Employee(2, "Michael", "Developer",10);
我比较两个对象,并得到
Diff diff = javers.compare(emp1,emp2);
List<Change> changes = diff.getChanges();
有了这个,我得到了(id,name,professional)具有各自左和右值的已更改属性。
有什么方法可以将“体验”也包含在“更改”中,并且左右值是否相同?
答案 0 :(得分:1)
最简单的答案是否定的,“更改”视图仅报告更改的内容。也许您需要“快照”视图或“阴影”视图?
请参阅https://javers.org/documentation/jql-examples/#data-history-views