Vault Queries across LinearStates and FungibleState tables return incorrect results

Description

As a user of the Vault Query API,
I am unable to obtain the correct expected results when issuing composite queries using both FungibleAsset and LinearState tables.

The following code excerpts highlight the failures:
Pre-condition: inserted 2 LinearStates and 1 FungibleAsset state into the vault.

correctly returns 3 states

correctly returns 2 states.

correctly returns 1 state.

However both the following composite queries return 0 states:

If we examine the generated Hibernate SQL for the latter query:

we can see that the WHERE clause is expecting to find ALL the vault states (3) in both the joined tables.

This issue also means it is not possible to use the participants filter query criteria to obtain all Fungible And Linear states from a single query.

Assignee

Jose Coll

Reporter

Jose Coll

Labels

None

Priority

Medium

Fix versions

Ported to...

None

Feature Team

Corda Core

CVSS Vector

None

Severity

Medium

Affects versions

Configure