Corda 4.7 QueryCriteria, LinearStateQueryCriteria

Viewed 178

I have below query criteria to fetch State based on linearId. I am trying below code

//query criteria
QueryCriteria queryCriteria = new LinearStateQueryCriteria(
    null,
    ImmutableList.of(UUID.fromString(linearId)) 
);

However, I am getting a compile time error asking to change QueryCriteria to QueryCriteria.LinearStateQueryCriteria. If I do that, then vaultService.queryBy() does not accept the queryCriteria and throws a compile time error.

Compile Time Error

As per documentation, API: Vault Query - Custom queries in Java it should have worked. Can someone help ?

1 Answers
Related