Skip to content

Commit d9f34f8

Browse files
committed
Sync documentation of main branch
1 parent 72f4c6d commit d9f34f8

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

_versions/main/guides/hibernate-orm-panache.adoc

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,9 @@ List<Person> allPersons = Person.listAll();
223223
// finding a specific person by ID
224224
person = Person.findById(personId);
225225
226+
// finding specific persons by their IDs
227+
List<Person> personsById = Person.findByIds(List.of(personId1, personId2));
228+
226229
// finding a specific person by ID via an Optional
227230
Optional<Person> optional = Person.findByIdOptional(personId);
228231
person = optional.orElseThrow(() -> new NotFoundException());
@@ -441,6 +444,9 @@ List<Person> allPersons = personRepository.listAll();
441444
// finding a specific person by ID
442445
person = personRepository.findById(personId);
443446
447+
// finding specific persons by their IDs
448+
List<Person> personsById = personRepository.findByIds(List.of(personId1, personId2);
449+
444450
// finding a specific person by ID via an Optional
445451
Optional<Person> optional = personRepository.findByIdOptional(personId);
446452
person = optional.orElseThrow(() -> new NotFoundException());

_versions/main/guides/mongodb-panache.adoc

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,6 +205,11 @@ List<Person> allPersons = Person.listAll();
205205
ObjectId personId = new ObjectId(idAsString);
206206
person = Person.findById(personId);
207207
208+
// finding a specific persons by their ID
209+
ObjectId personId1 = new ObjectId(id1AsString);
210+
ObjectId personId2 = new ObjectId(id2AsString);
211+
List<Person> person = Person.findByIds(List.of(personId1, personId2);
212+
208213
// finding a specific person by ID via an Optional
209214
Optional<Person> optional = Person.findByIdOptional(personId);
210215
person = optional.orElseThrow(() -> new NotFoundException());
@@ -373,6 +378,11 @@ List<Person> allPersons = personRepository.listAll();
373378
ObjectId personId = new ObjectId(idAsString);
374379
person = personRepository.findById(personId);
375380
381+
// finding a specific persons by their ID
382+
ObjectId personId1 = new ObjectId(id1AsString);
383+
ObjectId personId2 = new ObjectId(id2AsString);
384+
List<Person> person = personRepository.findByIds(List.of(personId1, personId2);
385+
376386
// finding a specific person by ID via an Optional
377387
Optional<Person> optional = personRepository.findByIdOptional(personId);
378388
person = optional.orElseThrow(() -> new NotFoundException());
@@ -863,7 +873,7 @@ data class Person (
863873

864874
[IMPORTANT]
865875
====
866-
Unlike the @BsonCreator approach, `val` cannot be used here. Properties must be defined as `var`, otherwise, the system creates an object with
876+
Unlike the @BsonCreator approach, `val` cannot be used here. Properties must be defined as `var`, otherwise, the system creates an object with
867877
`null` values for every property.
868878
====
869879

@@ -935,6 +945,11 @@ Uni<List<ReactivePerson>> allPersons = ReactivePerson.listAll();
935945
ObjectId personId = new ObjectId(idAsString);
936946
Uni<ReactivePerson> personById = ReactivePerson.findById(personId);
937947
948+
// finding a specific persons by their ID
949+
ObjectId personId1 = new ObjectId(id1AsString);
950+
ObjectId personId2 = new ObjectId(id2AsString);
951+
Uni<List<Person>> person = ReactivePerson.findByIds(List.of(personId1, personId2);
952+
938953
// finding a specific person by ID via an Optional
939954
Uni<Optional<ReactivePerson>> optional = ReactivePerson.findByIdOptional(personId);
940955
personById = optional.map(o -> o.orElseThrow(() -> new NotFoundException()));

0 commit comments

Comments
 (0)