CashSelectionPostgreSQLImpl.executeQuery - corda

corda / net.corda.finance.workflows.asset.selection / CashSelectionPostgreSQLImpl / executeQuery

# executeQuery

`protected fun executeQuery(connection: Connection, amount: Amount<Currency>, lockId: UUID, notary: Party?, onlyFromIssuerParties: Set<AbstractParty>, withIssuerRefs: Set<OpaqueBytes>, withResultSet: (ResultSet) -> Boolean): Boolean`

A vendor specific query(ies) to gather Cash states that are available.

### Parameters

`amount` - The amount of currency desired (ignoring issues, but specifying the currency)

`lockId` - The FlowLogic.runId.uuid of the flow, which is used to soft reserve the states. Also, previous outputs of the flow will be eligible as they are implicitly locked with this id until the flow completes.

`notary` - If null the notary source is ignored, if specified then only states marked with this notary are included.

`onlyFromIssuerParties` - Optional issuer parties to match against.

`withIssuerRefs` - Optional issuer references to match against.

`withResultSet` - Function that contains the business logic. The JDBC ResultSet with the matching states that were found. If sufficient funds were found these will be locked, otherwise what is available is returned unlocked for informational purposes.

Return
The result of the withResultSet function