具有提交属性过滤器的anyDomainObject的Javers querybuilder不起作用

时间:2019-02-10 00:50:49

标签: javers

获取所有域对象的Javers JQL返回空列表。

我编写了一个包装器rest api,并公开了Javers commit和getAllShadows api,如下所示。

@PutMapping("/commit")
public <T> CommitEntity<T> commit(@RequestBody CommitEntity<T> committedObject);

@GetMapping("/getEntityShadows")
public List<EntityShadow> getEntityShadows(@RequestParam(name = "entityId") String entityId);

现在,当我使用上述提交API时,我可以将域对象提交到存储库中(mongo)

以下示例:

{
"_id" : ObjectId("5c5f6fb51ebaa93b96edadc8"),
"commitMetadata" : {
    "author" : "UserFName UserLname",
    "properties" : [ 
        {
            "key" : "entityId",
            "value" : "user001/US"
        }
    ],
    "commitDate" : "2019-02-09T16:26:29.543",
    "commitDateInstant" : "2019-02-10T00:26:29.543Z",
    "id" : NumberLong(8440229536252376064)
},
"globalId" : {
    "valueObject" : "org.javers.core.graph.LiveGraphFactory$MapWrapper"
},
"state" : {
    "map" : {
        "userId" : {
            "id" : "user001",
            "locale" : "US"
        },
        "createdDate" : "2019-02-08T22:16:58",
        "Name" : "User Fname",
        "address" : {
            "state" : "CA",
            "country" : "US"
        },
        "authorName" : "UserFName UserLname",
        "lastModifiedBy" : "2019-02-09T16:26:29"
    }
},
"changedProperties" : [ 
    "map"
],
"type" : "INITIAL",
"version" : NumberLong(1),
"globalId_key" : "org.javers.core.graph.LiveGraphFactory$MapWrapper/"

}

现在,当我尝试获取如下所示的所有阴影时,我将返回一个空列表。我期望从仓库中得到所有的阴影。

JqlQuery jqlQuery = QueryBuilder.anyDomainObject().withCommitProperty("entityId", "user001/US").build();
List<Shadow<Object>> shadows = javers.findShadows(jqlQuery);

我在这里错过了什么吗?

我试图用下面的任何滤镜获取阴影,但仍然返回一个空列表

JqlQuery jqlQuery = QueryBuilder.anyDomainObject().build();
List<Shadow<Object>> shadows = javers.findShadows(jqlQuery);

0 个答案:

没有答案