-
Notifications
You must be signed in to change notification settings - Fork 453
Open
Labels
docsforward-portIssues automatically duplicated from other versions via an actionIssues automatically duplicated from other versions via an action
Milestone
Description
Duplicate of #3403 for milestone 3.0.0
Hello Morphia Team,
I am currently using Morphia 2.4.4 and encountering deprecation warnings when using MapperOptions.Builder
, despite documentation suggesting it was undeprecated as of version 2.4.
Issue Description:
When initializing MapperOptions
with the builder pattern, a deprecation and removal warning is displayed. **
Warning
'dev.morphia.mapping.MapperOptions.Builder' is deprecated since version 2.4.0 and marked for removal.
Sample Code
public class SomeClass extends DatastoreImpl {
private static Datastore initDS(final MongoClient moClient, final String db) {
MapperOptions options = MapperOptions.builder()
.collectionNaming(NamingStrategy.identity())
.build();
return Morphia.createDatastore(moClient, db)
.configure(options);
}
public SomeClass(final Morphia morphia, final MongoClient mongoClient, final String dbName) {
super(initDS(mongoClient, dbName));
}
private void ensureAndPopulateIndexes() {
// Ensure and populate indexes as necessary
}
private void initType(Class<T> entityClass) {
// Initialize entity type
}
}
**Server Version**: MongoDB v5.30
**Driver Version**: MongoDB driver 4.11
**Morphia Version**: 2.4.4
Metadata
Metadata
Assignees
Labels
docsforward-portIssues automatically duplicated from other versions via an actionIssues automatically duplicated from other versions via an action