Skip to content
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
12 changes: 10 additions & 2 deletions base/build.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2025, TeamDev. All rights reserved.
* Copyright 2026, TeamDev. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -89,7 +89,6 @@ tasks {
excludeGoogleProtoFromArtifacts()
}


// For generating test fixtures. See `src/test/proto`.
protobuf {
configurations.excludeProtobufLite()
Expand All @@ -99,6 +98,15 @@ protobuf {
}

generateProtoTasks.all().configureEach {
// The `doLast` action below deletes files from this task's own output
// directory, which is not reproduced when the task is restored from the
// Gradle build cache. A cached restoration yields an output (and a
// downstream descriptor set on the test classpath) that differs from a
// fresh run, intermittently leaving `io.spine.type.KnownTypes` with an
// incomplete set of types. Opt this task out of the build cache so it
// always executes and the deletion is always applied.
Comment on lines +105 to +107
outputs.cacheIf { false }
Comment on lines +104 to +108

// Delete files generated in `com.google` packages because
// we add `protobuf(Protobuf.protoSrcLib)` dependency above.
doLast {
Expand Down
30 changes: 28 additions & 2 deletions base/src/main/java/io/spine/query/QueryCriterion.java
Original file line number Diff line number Diff line change
Expand Up @@ -86,18 +86,44 @@ abstract class QueryCriterion<R extends Message,

/**
* Appends an associated query builder with a criterion checking that the value
* of the associated column equals to the one provided.
* of the associated column equals the one provided.
*
* <p>The shorter {@link #is(Object) is()} alias has the same effect and reads more
* fluently from Java. Prefer this method in Kotlin, where {@code is} is a reserved
* word and calling {@code is()} requires wrapping the name in backticks.
*
* @param value
* the column value to use when querying
* @return the instance of query builder associated with this criterion
* @see #is(Object)
*/
@CanIgnoreReturnValue
public B is(V value) {
public B isEqualTo(V value) {
checkNotNull(value);
return addParameter(builder, column, EQUALS, value);
}

/**
* Appends an associated query builder with a criterion checking that the value
* of the associated column equals the one provided.
*
* <p>This method is a short form of {@link #isEqualTo(Object) isEqualTo()}.
* It is a convenience wrapper for working with a {@code QueryCriterion} from Java.
*
* <p>In Kotlin, prefer {@link #isEqualTo(Object) isEqualTo()} because {@code is} is
* a reserved word there, so calling this method requires wrapping its name in
* backticks.
*
* @param value
* the column value to use when querying
* @return the instance of query builder associated with this criterion
* @see #isEqualTo(Object)
*/
@CanIgnoreReturnValue
public B is(V value) {
return isEqualTo(value);
}

/**
* Appends an associated query builder with a criterion checking that the value
* of the associated column is less than the one provided.
Expand Down
36 changes: 34 additions & 2 deletions base/src/test/java/io/spine/query/RecordQueryBuilderTest.java
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
/*
* Copyright 2022, TeamDev. All rights reserved.
* Copyright 2026, TeamDev. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
* https://www.apache.org/licenses/LICENSE-2.0
*
* Redistribution and use in source and/or binary forms, with or without
* modification, must retain the above copyright notice and the following
Expand Down Expand Up @@ -254,6 +254,38 @@ void returnSameBuilder() {
}
}

@Nested
@DisplayName("support filtering by given values")
final class IsEqualTo {

@Test
@DisplayName("appending an `EQUALS` parameter via `isEqualTo`")
void appendEqualsParameter() {
var isinValue = "JP 3496600002";
var parameters = queryManufacturer()
.where(isin).isEqualTo(isinValue)
.predicate()
.parameters();
assertThat(parameters).hasSize(1);
assertHasParamValue(parameters, isin, EQUALS, isinValue);
}

@Test
@DisplayName("providing `is` alias for `isEqualTo`")
void matchIs() {
var isinValue = "JP 3496600002";
var viaIs = queryManufacturer()
.where(isin).is(isinValue)
.predicate()
.parameters();
var viaIsEqualTo = queryManufacturer()
.where(isin).isEqualTo(isinValue)
.predicate()
.parameters();
assertThat(viaIsEqualTo).isEqualTo(viaIs);
}
}

@Nested
@DisplayName("prevent")
final class Prevent {
Expand Down
16 changes: 8 additions & 8 deletions docs/dependencies/dependencies.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@


# Dependencies of `io.spine:spine-annotations:2.0.0-SNAPSHOT.420`
# Dependencies of `io.spine:spine-annotations:2.0.0-SNAPSHOT.421`

## Runtime
1. **Group** : org.jetbrains. **Name** : annotations. **Version** : 26.1.0.
Expand Down Expand Up @@ -760,14 +760,14 @@

The dependencies distributed under several licenses, are used according their commercial-use-friendly license.

This report was generated on **Thu Jun 18 20:57:17 WEST 2026** using
This report was generated on **Tue Jun 23 00:11:07 WEST 2026** using
[Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under
[Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE).




# Dependencies of `io.spine:spine-base:2.0.0-SNAPSHOT.420`
# Dependencies of `io.spine:spine-base:2.0.0-SNAPSHOT.421`

## Runtime
1. **Group** : com.google.code.findbugs. **Name** : jsr305. **Version** : 3.0.2.
Expand Down Expand Up @@ -1604,14 +1604,14 @@ This report was generated on **Thu Jun 18 20:57:17 WEST 2026** using

The dependencies distributed under several licenses, are used according their commercial-use-friendly license.

This report was generated on **Thu Jun 18 20:57:17 WEST 2026** using
This report was generated on **Tue Jun 23 00:11:07 WEST 2026** using
[Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under
[Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE).




# Dependencies of `io.spine:spine-environment:2.0.0-SNAPSHOT.420`
# Dependencies of `io.spine:spine-environment:2.0.0-SNAPSHOT.421`

## Runtime
1. **Group** : com.google.code.findbugs. **Name** : jsr305. **Version** : 3.0.2.
Expand Down Expand Up @@ -2430,14 +2430,14 @@ This report was generated on **Thu Jun 18 20:57:17 WEST 2026** using

The dependencies distributed under several licenses, are used according their commercial-use-friendly license.

This report was generated on **Thu Jun 18 20:57:17 WEST 2026** using
This report was generated on **Tue Jun 23 00:11:07 WEST 2026** using
[Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under
[Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE).




# Dependencies of `io.spine:spine-format:2.0.0-SNAPSHOT.420`
# Dependencies of `io.spine:spine-format:2.0.0-SNAPSHOT.421`

## Runtime
1. **Group** : com.fasterxml.jackson. **Name** : jackson-bom. **Version** : 2.22.0.
Expand Down Expand Up @@ -3336,6 +3336,6 @@ This report was generated on **Thu Jun 18 20:57:17 WEST 2026** using

The dependencies distributed under several licenses, are used according their commercial-use-friendly license.

This report was generated on **Thu Jun 18 20:57:17 WEST 2026** using
This report was generated on **Tue Jun 23 00:11:07 WEST 2026** using
[Gradle-License-Report plugin](https://github.com/jk1/Gradle-License-Report) by Evgeny Naumenko, licensed under
[Apache 2.0 License](https://github.com/jk1/Gradle-License-Report/blob/master/LICENSE).
2 changes: 1 addition & 1 deletion docs/dependencies/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ all modules and does not describe the project structure per-subproject.
-->
<groupId>io.spine</groupId>
<artifactId>base-libraries</artifactId>
<version>2.0.0-SNAPSHOT.420</version>
<version>2.0.0-SNAPSHOT.421</version>

<inceptionYear>2015</inceptionYear>

Expand Down
4 changes: 2 additions & 2 deletions version.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2025, TeamDev. All rights reserved.
* Copyright 2026, TeamDev. All rights reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand All @@ -24,4 +24,4 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

val versionToPublish: String by extra("2.0.0-SNAPSHOT.420")
val versionToPublish: String by extra("2.0.0-SNAPSHOT.421")
Loading