Skip to content

Commit 5d293c4

Browse files
committed
Polishing.
Tweak wording. See #2794 Original pull request: #2794
1 parent 02ed197 commit 5d293c4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

Diff for: src/main/asciidoc/repository-projections.adoc

+4-2
Original file line numberDiff line numberDiff line change
@@ -235,14 +235,16 @@ The following example shows a projecting DTO:
235235

236236
.A projecting DTO
237237
====
238-
[source, java]
238+
[source,java]
239239
----
240240
record NamesOnly(String firstname, String lastname) {
241241
}
242242
----
243243
====
244244

245-
Records are ideal DTOs since they adhere to value semantics (all fields are private final, `equals(…)` and `hashCode()` are provided by default), but you are free to use any class with a constructor listing the fields to be retrieved.
245+
Java Records are ideal to define DTO types since they adhere to value semantics:
246+
All fields are `private final` and ``equals(…)``/``hashCode()``/``toString()`` methods are created automatically.
247+
Alternatively, you can use any class that defines the properties you want to project.
246248

247249
ifdef::repository-projections-trailing-dto-fragment[]
248250
include::{repository-projections-trailing-dto-fragment}[]

0 commit comments

Comments
 (0)