我试图从迁移到SDN 4.2
和SDN 5
OGM 3
春数据的Neo4j 5 OGM 3和Spring引导2.0.0.M4
一切几乎完美的作品,除了一种情况。
现在为了节省我必须使用深度= 2,而不是深度= 1就像在SDN 4.2
这很难解释有那么我创建在GitHub的一个示范项目再现这个问题的实体 - https://github.com/Artgit/spring-boot-2.0.0.M4-sdn5-ogm3-saving-issue
重现步骤:
如果你想使用自己的Neo4j的情况下,请跳过步骤#1,并开始从第2步阅读。为了旋转起来的Neo4j 3.2.5在泊坞容器(必须安装泊坞)
执行测试
运行
mvn docker:start -Dfile.encoding=UTF-8
com.decisionwanted.domain.DecisionCharacteristicIT.testUpdateValue()
试验应失败,并断言:
java.lang.AssertionError: expected:<BaseEntity [id=3, class=class com.decisionwanted.domain.model.user.User, createDate=Wed Oct 04 21:54:17 EEST 2017, updateDate=Wed Oct 04 21:54:17 EEST 2017]> but was:<BaseEntity [id=2, class=class com.decisionwanted.domain.model.user.User, createDate=Wed
正如你可以从下面看到的NG代码:
rdbmsHorScalingValue = valueDao.update(rdbmsHorScalingValue, newStringValue2, newStringDescription2, user3,
null);
assertEquals(user3, rdbmsHorScalingValue.getUpdateUser());
rdbmsHorScalingValue = valueDao.getById(rdbmsHorScalingValue.getId());
assertEquals(user3, rdbmsHorScalingValue.getUpdateUser()); // Error here !!!!
我与用户3和ID得到Value
后更新rdbmsHorScalingValue
(valueDao.getById())
我希望这个用户为rdbmsHorScalingValue.getUpdateUser()
但不知什么原因,这是不正确的。
但是,如果我们改变以下方法:com.decisionwanted.domain.dao.decision.characteristic.value.history.HistoryValueDaoImpl.create(Value)
节省深度从1
到2
- 一切都开始正常工作。
现在我不知道问题出在哪里,也不知道我知道的唯一的东西 - 它在使用SDN 4.2节省深度= 1时工作正常。
请告诉我问题在哪里(为什么它不适用于SDN 5)以及如何解决问题。