Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CORE-16870 Support nullable parameters in queries #1417

Merged
merged 7 commits into from
Dec 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package net.corda.v5.application.persistence;

import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.Map;

Expand Down Expand Up @@ -54,7 +55,7 @@ public interface ParameterizedQuery<R> extends PagedQuery<R> {
* @return the same {@link ParameterizedQuery} instance.
*/
@NotNull
ParameterizedQuery<R> setParameter(@NotNull String name, @NotNull Object value);
ParameterizedQuery<R> setParameter(@NotNull String name, @Nullable Object value);

/**
* Sets the parameters as a {@link Map}.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
"name": "parameters",
"type": {
"type": "map",
"values": "bytes"
"values": ["null", "bytes"]
},
"doc": "Parameters for the query, with each value represented as a bytes array payload serialized in AMQP format. Null values must be tested using IS NULL in the query; it is not possible to pass in a null as a parameter value. "
},
Expand Down
2 changes: 1 addition & 1 deletion gradle.properties
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ cordaProductVersion = 5.2.0
# NOTE: update this each time this module contains a breaking change
## NOTE: currently this is a top level revision, so all API versions will line up, but this could be moved to
## a per module property in which case module versions can change independently.
cordaApiRevision = 21
cordaApiRevision = 22

# Main
kotlin.stdlib.default.dependency = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import net.corda.v5.ledger.utxo.StateAndRef;
import net.corda.v5.ledger.utxo.UtxoLedgerService;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.time.Instant;
import java.util.Map;
Expand Down Expand Up @@ -45,7 +46,7 @@ public interface VaultNamedParameterizedQuery<R> extends ParameterizedQuery<R> {
*/
@Override
@NotNull
VaultNamedParameterizedQuery<R> setParameter(@NotNull String name, @NotNull Object value);
VaultNamedParameterizedQuery<R> setParameter(@NotNull String name, @Nullable Object value);

/**
* @see ParameterizedQuery#setParameters(Map)
Expand Down