Skip to content

Commit 29ea489

Browse files
Update Reference Documentation.
Closes: #3484
1 parent 9ae4bf9 commit 29ea489

22 files changed

Lines changed: 63 additions & 60 deletions

src/main/antora/modules/ROOT/pages/aot.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ If Ahead of Time compilation is enabled Spring Data can (depending on the actual
2929
* Repository Metadata in JSON format
3030

3131
Each of the above is enabled by default.
32-
However, there users may fine tune the configuration with following options.
32+
However, users may fine-tune the configuration with the following options.
3333

3434
[options = "autowidth",cols="1,1"]
3535
|===

src/main/antora/modules/ROOT/pages/auditing.adoc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,14 @@
33

44
[[auditing.basics]]
55
== Basics
6-
Spring Data provides sophisticated support to transparently keep track of who created or changed an entity and when the change happened.To benefit from that functionality, you have to equip your entity classes with auditing metadata that can be defined either using annotations or by implementing an interface.
6+
Spring Data provides sophisticated support to transparently keep track of who created or changed an entity and when the change happened.
7+
To benefit from that functionality, you have to equip your entity classes with auditing metadata that can be defined either using annotations or by implementing an interface.
78
Additionally, auditing has to be enabled either through Annotation configuration or XML configuration to register the required infrastructure components.
89
Please refer to the store-specific section for configuration samples.
910

1011
[NOTE]
1112
====
12-
Applications that only track creation and modification dates are not required do make their entities implement <<auditing.auditor-aware,`AuditorAware`>>.
13+
Applications that only track creation and modification dates are not required to make their entities implement <<auditing.auditor-aware,`AuditorAware`>>.
1314
====
1415

1516
[[auditing.annotations]]

src/main/antora/modules/ROOT/pages/custom-conversions.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
[[custom-conversions]]
12
= Custom Conversions
23

34
The following example of a Spring `Converter` implementation converts from a `String` to a custom `Email` value object:

src/main/antora/modules/ROOT/pages/dependencies.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ You can find a working example of using the BOMs in our https://github.com/sprin
3737
<groupId>org.springframework.data</groupId>
3838
<artifactId>spring-data-jpa</artifactId>
3939
</dependency>
40-
<dependencies>
40+
</dependencies>
4141
----
4242

4343
[[dependencies.spring-boot]]

src/main/antora/modules/ROOT/pages/entity-callbacks.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,11 +77,11 @@ class DefaultingEntityCallback implements BeforeSaveCallback<Person>, Ordered {
7777
@Override
7878
public Object onBeforeSave(Person entity, String collection) { <1>
7979
80-
if(collection == "user") {
81-
return // ...
80+
if("user".equals(collection)) {
81+
return …;
8282
}
8383
84-
return // ...
84+
return …;
8585
}
8686
8787
@Override

src/main/antora/modules/ROOT/pages/kotlin.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ https://kotlinlang.org[Kotlin] is a statically typed language that targets the J
66

77
Spring Data provides first-class support for Kotlin and lets developers write Kotlin applications almost as if Spring Data was a Kotlin native framework.
88

9-
The easiest way to build a Spring application with Kotlin is to leverage Spring Boot and its https://docs.spring.io/spring-boot/docs/current/reference/html/boot-features-kotlin.html[dedicated Kotlin support].
9+
The easiest way to build a Spring application with Kotlin is to leverage Spring Boot and its https://docs.spring.io/spring-boot/reference/features/kotlin.html[dedicated Kotlin support].
1010
This comprehensive https://spring.io/guides/tutorials/spring-boot-kotlin/[tutorial] will teach you how to build Spring Boot applications with Kotlin using https://start.spring.io/#!language=kotlin&type=gradle-project[start.spring.io].
1111

1212

src/main/antora/modules/ROOT/pages/kotlin/coroutines.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Coroutines support is enabled when `kotlinx-coroutines-core`, `kotlinx-coroutine
3232
</dependency>
3333
----
3434

35-
NOTE: Supported versions `1.3.0` and above.
35+
NOTE: Supported versions `1.7.0` and above.
3636

3737
[[kotlin.coroutines.reactive]]
3838
== How Reactive translates to Coroutines?

src/main/antora/modules/ROOT/pages/kotlin/null-safety.adoc

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -5,18 +5,17 @@ One of Kotlin's key features is https://kotlinlang.org/docs/null-safety.html[nul
55
This makes applications safer through nullability declarations and the expression of "`value or no value`" semantics without paying the cost of wrappers, such as `Optional`.
66
(Kotlin allows using functional constructs with nullable values. See this https://www.baeldung.com/kotlin/null-safety[comprehensive guide to Kotlin null safety].)
77

8-
Although Java does not let you express null safety in its type system, Spring Data API is annotated with https://jcp.org/en/jsr/detail?id=305[JSR-305] tooling friendly annotations declared in the `org.springframework.lang` package.
9-
By default, types from Java APIs used in Kotlin are recognized as https://kotlinlang.org/docs/reference/java-interop.html#null-safety-and-platform-types[platform types], for which null checks are relaxed.
10-
https://kotlinlang.org/docs/reference/java-interop.html#jsr-305-support[Kotlin support for JSR-305 annotations] and Spring nullability annotations provide null safety for the whole Spring Data API to Kotlin developers, with the advantage of dealing with `null` related issues at compile time.
11-
12-
See xref:repositories/null-handling.adoc[Null Handling of Repository Methods] how null safety applies to Spring Data Repositories.
13-
14-
[TIP]
8+
[NOTE]
159
====
16-
You can configure JSR-305 checks by adding the `-Xjsr305` compiler flag with the following options: `-Xjsr305={strict|warn|ignore}`.
17-
18-
For Kotlin versions 1.1+, the default behavior is the same as `-Xjsr305=warn`.
19-
The `strict` value is required take Spring Data API null-safety into account. Kotlin types inferred from Spring API but should be used with the knowledge that Spring API nullability declaration could evolve, even between minor releases and that more checks may be added in the future.
10+
As of Spring Framework 7 and Spring Data 4, Spring Data uses https://jspecify.dev/docs/start-here/[JSpecify] for nullability annotations.
11+
The earlier https://jcp.org/en/jsr/detail?id=305[JSR-305]-based `org.springframework.lang` annotations are deprecated and should no longer be relied upon.
12+
See xref:repositories/null-handling.adoc[Null Handling of Repository Methods] for the current recommended approach.
2013
====
2114

22-
NOTE: Generic type arguments, varargs, and array elements nullability are not supported yet, but should be in an upcoming release.
15+
Although Java does not let you express null safety in its type system, the Spring Data API is annotated with JSpecify annotations.
16+
By default, types from Java APIs used in Kotlin are recognized as https://kotlinlang.org/docs/reference/java-interop.html#null-safety-and-platform-types[platform types], for which null checks are relaxed.
17+
JSpecify annotations provide null safety for the whole Spring Data API to Kotlin developers, with the advantage of dealing with `null`-related issues at compile time.
18+
19+
See xref:repositories/null-handling.adoc[Null Handling of Repository Methods] for details on how null safety applies to Spring Data repositories.
20+
21+
NOTE: Generic type arguments, varargs, and array element nullability are not supported yet, but should be in an upcoming release.
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[[kotlin.requirements]]
22
= Requirements
33

4-
Spring Data supports Kotlin 1.3 and requires `kotlin-stdlib` (or one of its variants, such as `kotlin-stdlib-jdk8`) and `kotlin-reflect` to be present on the classpath.
5-
Those are provided by default if you bootstrap a Kotlin project via https://start.spring.io/#!language=kotlin&type=gradle-project[start.spring.io].
4+
Spring Data supports Kotlin 1.9 and above and requires `kotlin-stdlib` and `kotlin-reflect` to be present on the classpath.
5+
Those are provided by default if you bootstrap a Kotlin project via https://start.spring.io/#!language=kotlin&type=gradle-project[start.spring.io].

src/main/antora/modules/ROOT/pages/object-mapping.adoc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ If you want Spring Data to use the factory method for object instantiation, anno
214214
== General recommendations
215215

216216
* _Try to stick to immutable objects_ -- Immutable objects are straightforward to create as materializing an object is then a matter of calling its constructor only.
217-
Also, this avoids your domain objects to be littered with setter methods that allow client code to manipulate the objects state.
217+
Also, this avoids littering your domain objects with setter methods that allow client code to manipulate the object's state.
218218
If you need those, prefer to make them package protected so that they can only be invoked by a limited amount of co-located types.
219219
Constructor-only materialization is up to 30% faster than properties population.
220220
* _Provide an all-args constructor_ -- Even if you cannot or don't want to model your entities as immutable values, there's still value in providing a constructor that takes all properties of the entity as arguments, including the mutable ones, as this allows the object mapping to skip the property population for optimal performance.

0 commit comments

Comments
 (0)