Skip to content

Add AOT support for dynamic projections, streaming/scroll queries and Meta annotation #4970

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 56 commits into from
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
56 commits
Select commit Hold shift + click to select a range
78998ff
Adding queryable encryption range support
rozza Jan 24, 2025
aec2398
Introduce Queryable annotation and add Schema derivation.
christophstrobl Feb 25, 2025
efbea03
Polishing.
mp911de Apr 9, 2025
486e2f4
Update Javadoc.
christophstrobl Apr 14, 2025
5dff182
Prepare next development iteration.
mp911de Nov 19, 2024
b5c7e14
After release cleanups.
mp911de Nov 19, 2024
625b260
Adopt to deprecation removals in Commons.
mp911de Nov 19, 2024
179c6db
Remove commons-logging exclusion.
mp911de Jan 8, 2025
3f78916
Prepare 5.0 M1 (2025.1.0).
christophstrobl Jan 24, 2025
bd9018e
Release version 5.0 M1 (2025.1.0).
christophstrobl Jan 24, 2025
846eed1
Prepare next development iteration.
christophstrobl Jan 24, 2025
7094642
After release cleanups.
christophstrobl Jan 24, 2025
daf6827
Remove JMX support.
mp911de Apr 9, 2025
5dbdaca
Remove MongoDB driver 4 compatibility.
christophstrobl Apr 14, 2025
87f6264
Migrate to JSpecify annotations for nullability constraints.
christophstrobl Mar 12, 2025
2489314
Fix `@MongoId` mapping for `insertAll`.
christophstrobl Apr 11, 2025
198a37b
Polishing.
mp911de Apr 14, 2025
4244a88
Polishing.
mp911de Apr 14, 2025
394c807
Add support for MongoDB AOT Repositories.
christophstrobl Jan 9, 2025
4ff3efe
Adopt to Commons changes.
mp911de Mar 28, 2025
b856247
Extend AOT Repository Support.
christophstrobl Apr 7, 2025
9501461
Fix nullable annotations.
christophstrobl Apr 15, 2025
d5a07d7
Remove package-info from empty directory.
christophstrobl Apr 16, 2025
3aad80f
Update mongo-encryption.adoc
jyemin Apr 14, 2025
06d60ca
Update mongo-search-indexes.adoc.
alexbevi Mar 28, 2025
938cdc1
Use `awaitility` version property.
mp911de Apr 17, 2025
a9f48ae
Add support for sorting simple arrays (integers/strings) with SortArr…
Apr 10, 2025
d9a098f
Add support for sorting simple arrays by direction.
nathanukey Apr 2, 2025
256bdd7
Polishing.
christophstrobl Apr 11, 2025
81acf1b
Clarify QueryDSL usage in reference documentation.
mp911de Apr 22, 2025
9cec00c
Prepare 5.0 M2 (2025.1.0).
mp911de Apr 22, 2025
a84a365
Release version 5.0 M2 (2025.1.0).
mp911de Apr 22, 2025
f672185
Prepare next development iteration.
mp911de Apr 22, 2025
1919dad
After release cleanups.
mp911de Apr 22, 2025
740a206
Adopt to AOT changes in Commons.
mp911de May 7, 2025
8f9daf8
Update issue reference in tests.
christophstrobl May 9, 2025
a4cc5bb
Add support for fluent QueryResultConverter.
mp911de Apr 17, 2025
d76017f
Polishing.
mp911de Apr 17, 2025
0297d95
Support QueryResultConverter for delete, replace and update operations.
christophstrobl Apr 29, 2025
94f3207
Polishing.
mp911de May 8, 2025
d9e4948
Support QueryResultConverter for reactive delete, replace and update …
christophstrobl May 9, 2025
39594ba
Add missing issue reference to tests.
christophstrobl May 9, 2025
9893203
Adopt to documentation feature-flags in Commons.
mp911de May 9, 2025
d76f016
Use `LocalVariableNameFactory` to avoid parameter name clashes.
mp911de May 8, 2025
e2d371a
Add support for returning SearchResult from repository query methods.
mp911de Apr 10, 2025
48911f0
Polishing.
christophstrobl May 6, 2025
cac8e0c
Update CI Properties.
mp911de May 12, 2025
0f9d56a
Update CI Properties.
mp911de May 12, 2025
2656b3f
Upgrade to MongoDB driver 5.5.0
christophstrobl May 7, 2025
0432a6e
Remove MongoDB 6.0 docker build.
mp911de May 12, 2025
71a652b
Polishing.
mp911de May 12, 2025
2a183c0
Implement `RepositoryFactorySupport.getEntityInformation(RepositoryMe…
mp911de May 13, 2025
0e5abfa
Polishing.
mp911de May 13, 2025
155e6d1
Add AOT support for dynamic projections, streaming/scroll queries and…
mp911de May 14, 2025
0feb099
Fix aggregation streams, count result conversion.
mp911de May 14, 2025
47bb36b
Add repository benchmarks.
mp911de May 14, 2025
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
Prev Previous commit
Next Next commit
Polishing.
Initialize MongoId also for reactive insertAll(…).

See: #4944
Original pull request: #4945
  • Loading branch information
mp911de authored and christophstrobl committed Apr 22, 2025
commit 198a37b37f7bed3c36d19e57376d5a701456f8fa
Original file line number Diff line number Diff line change
Expand Up @@ -1450,11 +1450,16 @@ protected <T> Flux<T> doInsertBatch(String collectionName, Collection<? extends
entity.assertUpdateableIdIfNotSet();

T initialized = entity.initializeVersionProperty();
Document dbDoc = entity.toMappedDocument(writer).getDocument();
MappedDocument mapped = entity.toMappedDocument(writer);

maybeEmitEvent(new BeforeSaveEvent<>(initialized, dbDoc, collectionName));
maybeEmitEvent(new BeforeSaveEvent<>(initialized, mapped.getDocument(), collectionName));
return maybeCallBeforeSave(initialized, mapped.getDocument(), collectionName).map(toSave -> {

return maybeCallBeforeSave(initialized, dbDoc, collectionName).thenReturn(Tuples.of(entity, dbDoc));
MappedDocument mappedDocument = queryOperations.createInsertContext(mapped)
.prepareId(uninitialized.getClass());

return Tuples.of(entity, mappedDocument.getDocument());
});
});
}).collectList();

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.extension.ExtendWith;

import org.springframework.context.ConfigurableApplicationContext;
import org.springframework.context.support.GenericApplicationContext;
import org.springframework.dao.DataIntegrityViolationException;
Expand Down Expand Up @@ -84,6 +85,7 @@

import com.mongodb.WriteConcern;
import com.mongodb.reactivestreams.client.MongoClient;
import com.mongodb.reactivestreams.client.MongoCollection;

/**
* Integration test for {@link MongoTemplate}.
Expand Down Expand Up @@ -165,6 +167,19 @@ void insertCollectionSetsId() {
assertThat(person.getId()).isNotNull();
}

@Test // GH-4944
void insertAllShouldConvertIdToTargetTypeBeforeSave() {

RawStringId walter = new RawStringId();
walter.value = "walter";

RawStringId returned = template.insertAll(List.of(walter)).blockLast();
template.execute(RawStringId.class, MongoCollection::find) //
.as(StepVerifier::create) //
.consumeNextWith(actual -> assertThat(returned.id).isEqualTo(actual.get("_id"))) //
.verifyComplete();
}

@Test // DATAMONGO-1444
void saveSetsId() {

Expand Down