You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: modules/ROOT/pages/auditing.adoc
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -9,7 +9,7 @@ Please refer to the store-specific section for configuration samples.
9
9
10
10
[NOTE]
11
11
====
12
-
Applications that only track creation and modification dates are not required do make their entities implement <<auditing.auditor-aware, `AuditorAware`>>.
12
+
Applications that only track creation and modification dates are not required do make their entities implement xref:auditing.adoc#auditing.auditor-aware[`AuditorAware`].
Copy file name to clipboardExpand all lines: modules/ROOT/pages/dependencies.adoc
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -49,7 +49,7 @@ You can find a working example of using the BOMs in our https://github.com/sprin
49
49
== Dependency Management with Spring Boot
50
50
51
51
Spring Boot selects a recent version of the Spring Data modules for you. If you still want to upgrade to a newer version,
52
-
set the `spring-data-bom.version` property to the <<dependencies.train-version,train version and iteration>>
52
+
set the `spring-data-bom.version` property to the xref:dependencies.adoc#dependencies.train-version[train version and iteration]
53
53
you would like to use.
54
54
55
55
See Spring Boot's https://docs.spring.io/spring-boot/docs/current/reference/html/dependency-versions.html#appendix.dependency-versions.properties[documentation]
Copy file name to clipboardExpand all lines: modules/ROOT/pages/kotlin.adoc
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -25,7 +25,7 @@ Although Java does not let you express null safety in its type system, Spring Da
25
25
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.
26
26
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.
27
27
28
-
See <<repositories.nullability>> how null safety applies to Spring Data Repositories.
28
+
See xref:repositories-null-handling.adoc[Null Handling of Repository Methods] how null safety applies to Spring Data Repositories.
29
29
30
30
[TIP]
31
31
====
@@ -40,4 +40,4 @@ NOTE: Generic type arguments, varargs, and array elements nullability are not su
40
40
[[kotlin.mapping]]
41
41
== Object Mapping
42
42
43
-
See <<mapping.kotlin>> for details on how Kotlin objects are materialized.
43
+
See xref:object-mapping.adoc#mapping.kotlin[Kotlin support] for details on how Kotlin objects are materialized.
Copy file name to clipboardExpand all lines: modules/ROOT/pages/object-mapping.adoc
+3-3Lines changed: 3 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -78,13 +78,13 @@ For that we use the following algorithm:
78
78
1. If the property is immutable but exposes a `with…` method (see below), we use the `with…` method to create a new entity instance with the new property value.
79
79
2. If property access (i.e. access through getters and setters) is defined, we're invoking the setter method.
80
80
3. If the property is mutable we set the field directly.
81
-
4. If the property is immutable we're using the constructor to be used by persistence operations (see <<mapping.object-creation>>) to create a copy of the instance.
81
+
4. If the property is immutable we're using the constructor to be used by persistence operations (see xref:object-mapping.adoc#mapping.object-creation[Object creation]) to create a copy of the instance.
82
82
5. By default, we set the field value directly.
83
83
84
84
[[mapping.property-population.details]]
85
85
.Property population internals
86
86
****
87
-
Similarly to our <<mapping.object-creation.details,optimizations in object construction>> we also use Spring Data runtime generated accessor classes to interact with the entity instance.
87
+
Similarly to our xref:object-mapping.adoc#mapping.object-creation.details[optimizations in object construction] we also use Spring Data runtime generated accessor classes to interact with the entity instance.
88
88
89
89
[source,java]
90
90
----
@@ -305,7 +305,7 @@ Spring Data automatically tries to detect a persistent entity's constructor to b
305
305
The resolution algorithm works as follows:
306
306
307
307
1. If there is a constructor that is annotated with `@PersistenceCreator`, it is used.
308
-
2. If the type is a <<mapping.kotlin,Kotlin data cass>> the primary constructor is used.
308
+
2. If the type is a xref:object-mapping.adoc#mapping.kotlin[Kotlin data cass] the primary constructor is used.
309
309
3. If there is a single static factory method annotated with `@PersistenceCreator` then it is used.
310
310
4. If there is a single constructor, it is used.
311
311
5. If there are multiple constructors and exactly one is annotated with `@PersistenceCreator`, it is used.
Copy file name to clipboardExpand all lines: modules/ROOT/pages/query-by-example.adoc
+2-2Lines changed: 2 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -59,9 +59,9 @@ You can use it to create an `Example`.
59
59
By default, fields having `null` values are ignored, and strings are matched by using the store specific defaults.
60
60
61
61
NOTE: Inclusion of properties into a Query by Example criteria is based on nullability.
62
-
Properties using primitive types (`int`, `double`, …) are always included unless the <<query-by-example.matchers, `ExampleMatcher` ignores the property path>>.
62
+
Properties using primitive types (`int`, `double`, …) are always included unless the xref:query-by-example.adoc#query-by-example.matchers[`ExampleMatcher` ignores the property path].
63
63
64
-
Examples can be built by either using the `of` factory method or by using <<query-by-example.matchers,`ExampleMatcher`>>. `Example` is immutable.
64
+
Examples can be built by either using the `of` factory method or by using xref:query-by-example.adoc#query-by-example.matchers[`ExampleMatcher`]. `Example` is immutable.
Copy file name to clipboardExpand all lines: modules/ROOT/pages/repositories-null-handling.adoc
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -11,7 +11,7 @@ Besides that, Spring Data supports returning the following wrapper types on quer
11
11
Alternatively, query methods can choose not to use a wrapper type at all.
12
12
The absence of a query result is then indicated by returning `null`.
13
13
Repository methods returning collections, collection alternatives, wrappers, and streams are guaranteed never to return `null` but rather the corresponding empty representation.
14
-
See "`<<repository-query-return-types>>`" for details.
14
+
See "`xref:repository-query-return-types-reference.adoc[Repository query return types]`" for details.
Copy file name to clipboardExpand all lines: modules/ROOT/pages/repositories-scrolling.adoc
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,7 @@
3
3
4
4
Scrolling is a more fine-grained approach to iterate through larger results set chunks.
5
5
Scrolling consists of a stable sort, a scroll type (Offset- or Keyset-based scrolling) and result limiting.
6
-
You can define simple sorting expressions by using property names and define static result limiting using the <<repositories.limit-query-result,`Top` or `First` keyword>> through query derivation.
6
+
You can define simple sorting expressions by using property names and define static result limiting using the xref:repositories-paging-sorting.adoc#repositories.limit-query-result[`Top` or `First` keyword] through query derivation.
7
7
You can concatenate expressions to collect multiple criteria into one expression.
8
8
9
9
Scroll queries return a `Window<T>` that allows obtaining the scroll position to resume to obtain the next `Window<T>` until your application has consumed the entire query result.
Copy file name to clipboardExpand all lines: modules/ROOT/pages/repositories.adoc
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -18,7 +18,7 @@ This chapter explains the core concepts and interfaces of Spring Data repositori
18
18
The information in this chapter is pulled from the Spring Data Commons module.
19
19
It uses the configuration and code samples for the Jakarta Persistence API (JPA) module.
20
20
ifeval::[{include-xml-namespaces} != false]
21
-
If you want to use XML configuration you should adapt the XML namespace declaration and the types to be extended to the equivalents of the particular module that you use. "`<<repositories.namespace-reference>>`" covers XML configuration, which is supported across all Spring Data modules that support the repository API.
21
+
If you want to use XML configuration you should adapt the XML namespace declaration and the types to be extended to the equivalents of the particular module that you use. "`xref:repository-namespace-reference.adoc#repositories.namespace-reference[null]`" covers XML configuration, which is supported across all Spring Data modules that support the repository API.
22
22
endif::[]
23
23
"`<<repository-query-keywords>>`" covers the query method keywords supported by the repository abstraction in general.
24
24
For detailed information on the specific features of your module, see the chapter on that module of this document.
Copy file name to clipboardExpand all lines: modules/ROOT/pages/repositories/core-extensions.adoc
+8-8Lines changed: 8 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -93,11 +93,11 @@ It also detects Spring HATEOAS on the classpath and registers integration compon
93
93
[[core.web.basic]]
94
94
=== Basic Web Support
95
95
96
-
The configuration shown in the <<core.web,previous section>> registers a few basic components:
96
+
The configuration shown in the xref:repositories/core-extensions.adoc#core.web[previous section] registers a few basic components:
97
97
98
-
- A <<core.web.basic.domain-class-converter>> to let Spring MVC resolve instances of repository-managed domain classes from request parameters or path variables.
99
-
- <<core.web.basic.paging-and-sorting,`HandlerMethodArgumentResolver`>> implementations to let Spring MVC resolve `Pageable` and `Sort` instances from request parameters.
100
-
- <<core.web.basic.jackson-mappers, Jackson Modules>> to de-/serialize types like `Point` and `Distance`, or store specific ones, depending on the Spring Data Module used.
98
+
- A xref:repositories/core-extensions.adoc#core.web.basic.domain-class-converter[Using the `DomainClassConverter` Class] to let Spring MVC resolve instances of repository-managed domain classes from request parameters or path variables.
99
+
- xref:repositories/core-extensions.adoc#core.web.basic.paging-and-sorting[`HandlerMethodArgumentResolver`] implementations to let Spring MVC resolve `Pageable` and `Sort` instances from request parameters.
100
+
- xref:repositories/core-extensions.adoc#core.web.basic.jackson-mappers[Jackson Modules] to de-/serialize types like `Point` and `Distance`, or store specific ones, depending on the Spring Data Module used.
101
101
102
102
[[core.web.basic.domain-class-converter]]
103
103
==== Using the `DomainClassConverter` Class
@@ -130,7 +130,7 @@ NOTE: Currently, the repository has to implement `CrudRepository` to be eligible
130
130
[[core.web.basic.paging-and-sorting]]
131
131
==== HandlerMethodArgumentResolvers for Pageable and Sort
132
132
133
-
The configuration snippet shown in the <<core.web.basic.domain-class-converter,previous section>> also registers a `PageableHandlerMethodArgumentResolver` as well as an instance of `SortHandlerMethodArgumentResolver`.
133
+
The configuration snippet shown in the xref:repositories/core-extensions.adoc#core.web.basic.domain-class-converter[previous section] also registers a `PageableHandlerMethodArgumentResolver` as well as an instance of `SortHandlerMethodArgumentResolver`.
134
134
The registration enables `Pageable` and `Sort` as valid controller method arguments, as the following example shows:
135
135
136
136
.Using Pageable as a controller method argument
@@ -272,7 +272,7 @@ By default, the assembler points to the controller method it was invoked in, but
272
272
=== Spring Data Jackson Modules
273
273
274
274
The core module, and some of the store specific ones, ship with a set of Jackson Modules for types, like `org.springframework.data.geo.Distance` and `org.springframework.data.geo.Point`, used by the Spring Data domain. +
275
-
Those Modules are imported once <<core.web, web support>> is enabled and `com.fasterxml.jackson.databind.ObjectMapper` is available.
275
+
Those Modules are imported once xref:repositories/core-extensions.adoc#core.web[web support] is enabled and `com.fasterxml.jackson.databind.ObjectMapper` is available.
276
276
277
277
During initialization `SpringDataJacksonModules`, like the `SpringDataJacksonConfiguration`, get picked up by the infrastructure, so that the declared ``com.fasterxml.jackson.databind.Module``s are made available to the Jackson `ObjectMapper`.
278
278
@@ -294,7 +294,7 @@ Please refer to the store specific section for more details.
294
294
[[core.web.binding]]
295
295
=== Web Databinding Support
296
296
297
-
You can use Spring Data projections (described in <<projections>>) to bind incoming request payloads by using either https://goessner.net/articles/JsonPath/[JSONPath] expressions (requires https://github.com/json-path/JsonPath[Jayway JsonPath]) or https://www.w3.org/TR/xpath-31/[XPath] expressions (requires https://xmlbeam.org/[XmlBeam]), as the following example shows:
297
+
You can use Spring Data projections (described in xref:repository-projections.adoc[Projections]) to bind incoming request payloads by using either https://goessner.net/articles/JsonPath/[JSONPath] expressions (requires https://github.com/json-path/JsonPath[Jayway JsonPath]) or https://www.w3.org/TR/xpath-31/[XPath] expressions (requires https://xmlbeam.org/[XmlBeam]), as the following example shows:
298
298
299
299
.HTTP payload binding using JSONPath or XPath expressions
300
300
====
@@ -320,7 +320,7 @@ The `lastname` XML lookup is performed on the top-level of the incoming document
320
320
The JSON variant of that tries a top-level `lastname` first but also tries `lastname` nested in a `user` sub-document if the former does not return a value.
321
321
That way, changes in the structure of the source document can be mitigated easily without having clients calling the exposed methods (usually a drawback of class-based payload binding).
322
322
323
-
Nested projections are supported as described in <<projections>>.
323
+
Nested projections are supported as described in xref:repository-projections.adoc[Projections].
324
324
If the method returns a complex, non-interface type, a Jackson `ObjectMapper` is used to map the final value.
325
325
326
326
For Spring MVC, the necessary converters are registered automatically as soon as `@EnableSpringDataWebSupport` is active and the required dependencies are available on the classpath.
Extending the fragment interface with your repository interface combines the CRUD and custom functionality and makes it available to clients.
55
55
56
56
Spring Data repositories are implemented by using fragments that form a repository composition.
57
-
Fragments are the base repository, functional aspects (such as <<core.extensions.querydsl,QueryDsl>>), and custom interfaces along with their implementations.
57
+
Fragments are the base repository, functional aspects (such as xref:repositories/core-extensions.adoc#core.extensions.querydsl[QueryDsl]), and custom interfaces along with their implementations.
58
58
Each time you add an interface to your repository interface, you enhance the composition by adding a fragment.
59
59
The base repository and repository aspect implementations are provided by each Spring Data module.
60
60
@@ -216,7 +216,7 @@ If you annotate the `UserRepository` interface with `@Component("specialCustom")
216
216
==== Manual Wiring
217
217
218
218
If your custom implementation uses annotation-based configuration and autowiring only, the preceding approach shown works well, because it is treated as any other Spring bean.
219
-
If your implementation fragment bean needs special wiring, you can declare the bean and name it according to the conventions described in the <<repositories.single-repository-behaviour.ambiguity,preceding section>>.
219
+
If your implementation fragment bean needs special wiring, you can declare the bean and name it according to the conventions described in the xref:repositories/custom-implementations.adoc#repositories.single-repository-behaviour.ambiguity[preceding section].
220
220
The infrastructure then refers to the manually defined bean definition by name instead of creating one itself.
221
221
The following example shows how to manually wire a custom implementation:
222
222
@@ -250,7 +250,7 @@ endif::[]
250
250
[[repositories.customize-base-repository]]
251
251
== Customize the Base Repository
252
252
253
-
The approach described in the <<repositories.manual-wiring,preceding section>> requires customization of each repository interfaces when you want to customize the base repository behavior so that all repositories are affected.
253
+
The approach described in the xref:repositories/custom-implementations.adoc#repositories.manual-wiring[preceding section] requires customization of each repository interfaces when you want to customize the base repository behavior so that all repositories are affected.
254
254
To instead change behavior for all repositories, you can create an implementation that extends the persistence technology-specific repository base class.
255
255
This class then acts as a custom base class for the repository proxies, as shown in the following example:
Copy file name to clipboardExpand all lines: modules/ROOT/pages/repositories/definition.adoc
+4-4Lines changed: 4 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -68,8 +68,8 @@ In such cases, a repository definition must distinguish between persistence tech
68
68
When it detects multiple repository factories on the class path, Spring Data enters strict repository configuration mode.
69
69
Strict configuration uses details on the repository or the domain class to decide about Spring Data module binding for a repository definition:
70
70
71
-
. If the repository definition <<repositories.multiple-modules.types,extends the module-specific repository>>, it is a valid candidate for the particular Spring Data module.
72
-
. If the domain class is <<repositories.multiple-modules.annotations,annotated with the module-specific type annotation>>, it is a valid candidate for the particular Spring Data module.
71
+
. If the repository definition xref:repositories/definition.adoc#repositories.multiple-modules.types[extends the module-specific repository], it is a valid candidate for the particular Spring Data module.
72
+
. If the domain class is xref:repositories/definition.adoc#repositories.multiple-modules.annotations[annotated with the module-specific type annotation], it is a valid candidate for the particular Spring Data module.
73
73
Spring Data modules accept either third-party annotations (such as JPA's `@Entity`) or provide their own annotations (such as `@Document` for Spring Data MongoDB and Spring Data Elasticsearch).
74
74
75
75
The following example shows a repository that uses module-specific interfaces (JPA in this case):
@@ -151,14 +151,14 @@ One is intended for JPA and the other for MongoDB usage.
151
151
Spring Data is no longer able to tell the repositories apart, which leads to undefined behavior.
152
152
====
153
153
154
-
<<repositories.multiple-modules.types,Repository type details>> and <<repositories.multiple-modules.annotations,distinguishing domain class annotations>> are used for strict repository configuration to identify repository candidates for a particular Spring Data module.
154
+
xref:repositories/definition.adoc#repositories.multiple-modules.types[Repository type details] and xref:repositories/definition.adoc#repositories.multiple-modules.annotations[distinguishing domain class annotations] are used for strict repository configuration to identify repository candidates for a particular Spring Data module.
155
155
Using multiple persistence technology-specific annotations on the same domain type is possible and enables reuse of domain types across multiple persistence technologies.
156
156
However, Spring Data can then no longer determine a unique module with which to bind the repository.
157
157
158
158
The last way to distinguish repositories is by scoping repository base packages.
159
159
Base packages define the starting points for scanning for repository interface definitions, which implies having repository definitions located in the appropriate packages.
160
160
By default, annotation-driven configuration uses the package of the configuration class.
161
-
The <<repositories.create-instances.xml,base package in XML-based configuration>> is mandatory.
161
+
The xref:repositories/create-instances.adoc#repositories.create-instances.xml[base package in XML-based configuration] is mandatory.
162
162
163
163
The following example shows annotation-driven configuration of base packages:
0 commit comments