ValueObject deserialization exception #206
Comments
Thanks for reporting, will check it |
ok, I can reproduce it on H2 repository |
I hope you deal with it quickly ;) |
The problem (with deserialization) occurs also when updating entity with previously (initially) set reference ValueObjects. class Master {
@Id
String id;
Detail detail;
String data;
List<Detail> list = new ArrayList<>();
Set<Detail> set = new HashSet<>();
Map<String, Detail> map = new HashMap<>();
Detail[] array;
public Master(String id) {
this.id = id;
}
}
@ValueObject
class Detail {
String data;
public Detail(String data) {
this.data = data;
}
}
...
Master master = new Master("2");
master.data = "data";
master.detail = new Detail("details");
javers.commit("anonymous", master);
master.data = "data2";
javers.commit("anonymous", master);
List<Change> changes = javers
.findChanges(QueryBuilder.byInstanceId("2", Master.class)
.withNewObjectChanges(true)
.build());
String changeLog = javers.processChangeList(changes, getChangeLogger());
... During second commit the structure of previously saved json is changed from ownerId:entity to ownerId:instance/primaryKey and while deserialization exception occurs. Similar problem (with deserialization) occurs when using list/set/map/array of ValueObjects. |
bugs have high priority, expect a fix after weekend |
thanks ;) |
Przepraszam, że Cię nękam issues'ami, ale spodobał mi się javers i chciałem go nieco zewaluować ;) |
Miło, teraz jestem na wypadzie w Beskid Sądecki wiec ten bug musi poczekac do poniedzialku. Btw w javersie jest duże zapotrzebowanie na kontrybucje... |
OK, jak się wystarczająco wgryzę ;) |
Found a bug in serializing ValueObject references in sql repository. In some cases JSON is malformed |
fixed in v 1.3.10 |
Excellent, thanks ;) |
Hi,
Suppose two classes:
If I provide Detail object before initil commit, everything is OK:
If I provide Detail object before after initial commit, everything is OK:
I got deserialization error during findChanges operation (or third commit attempt):
In first (working) scenario master is serialized as:
In second scenario master is serialized as:
Could you fix this bug, please?
Cheers
Mariusz
The text was updated successfully, but these errors were encountered: