我是Javers的新手,我正在使用它为我的实体创建补丁更新。但我正在与一个特定的场景进行斗争
我想将Entity与EntityDTO / VO进行比较并仅获取值的更改,当前比较仅返回NewObject和ObjectRemoved更改。
示例:
public class Entity{
private ObjectId id;
private String name;
private String description;
}
public class EntityDTO{
private String name;
}
//
Entity oldState = new Entity(new ObjectId(), "oldName" , "oldDescription);
EntityDTO newState = new EntityDTO( "newName" );
JaversBuilder.javers().build().compare(oldState, newState).getChanges();
//This is returning only NewObject/ObjectRemoved changes, and the intended is to be ValueChange/ReferenceChange
问题是,有没有办法只比较对象之间的相似属性?
答案 0 :(得分:0)
不,在JaVers中,您只能比较相同类型的对象。