Package dev.morphia.mapping
Class MapperOptions.Builder
- java.lang.Object
-
- dev.morphia.mapping.MapperOptions.Builder
-
- Enclosing class:
- MapperOptions
@Deprecated(forRemoval=true, since="2.4.0") public static final class MapperOptions.Builder extends Object
Deprecated, for removal: This API element is subject to removal in a future version.use the new configuration file mechanism. See the website docs for more information.A builder class for setting mapping options
-
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description MapperOptions.Builder
addConvention(MorphiaConvention convention)
Deprecated, for removal: This API element is subject to removal in a future version.Adds a custom convention to the list to be applied to all new MorphiaModels.MapperOptions.Builder
autoImportModels(boolean autoImportModels)
Deprecated, for removal: This API element is subject to removal in a future version.This feature automatically discovers and usesEntityModelImporter
instances to allow for external definition of class models.MapperOptions
build()
Deprecated, for removal: This API element is subject to removal in a future version.MapperOptions.Builder
cacheClassLookups(boolean cacheClassLookups)
Deprecated, for removal: This API element is subject to removal in a future version.MapperOptions.Builder
classLoader(ClassLoader classLoader)
Deprecated, for removal: This API element is subject to removal in a future version.MapperOptions.Builder
codecProvider(CodecProvider codecProvider)
Deprecated, for removal: This API element is subject to removal in a future version.Sets a provider for user defined codecs to used by MorphiaMapperOptions.Builder
collectionNaming(NamingStrategy strategy)
Deprecated, for removal: This API element is subject to removal in a future version.Sets the naming strategy to use for collection namesMapperOptions.Builder
dateForm(DateStorage dateStorage)
Deprecated.usedateStorage(DateStorage)
instead.MapperOptions.Builder
dateStorage(DateStorage dateStorage)
Deprecated, for removal: This API element is subject to removal in a future version.The default value for this isDateStorage.UTC
.MapperOptions.Builder
disableEmbeddedIndexes(boolean disableEmbeddedIndexes)
Deprecated, for removal: This API element is subject to removal in a future version.unusedMapperOptions.Builder
discriminator(DiscriminatorFunction function)
Deprecated, for removal: This API element is subject to removal in a future version.Sets the discriminator function to useMapperOptions.Builder
discriminatorKey(String key)
Deprecated, for removal: This API element is subject to removal in a future version.Defines the discriminator key nameMapperOptions.Builder
enablePolymorphicQueries(boolean enablePolymorphicQueries)
Deprecated, for removal: This API element is subject to removal in a future version.MapperOptions.Builder
fieldNaming(NamingStrategy strategy)
Deprecated, for removal: This API element is subject to removal in a future version.usepropertyNaming(NamingStrategy)
insteadMapperOptions.Builder
ignoreFinals(boolean ignoreFinals)
Deprecated, for removal: This API element is subject to removal in a future version.MapperOptions.Builder
mapSubPackages(boolean mapSubPackages)
Deprecated, for removal: This API element is subject to removal in a future version.MapperOptions.Builder
propertyDiscovery(MapperOptions.PropertyDiscovery discovery)
Deprecated, for removal: This API element is subject to removal in a future version.3.0 will evaluate both field and getter/setters for annotation so this setting becomes vestigialMapperOptions.Builder
propertyNaming(NamingStrategy strategy)
Deprecated, for removal: This API element is subject to removal in a future version.Sets the naming strategy to use for propertys unless expliclity set via @PropertyMapperOptions.Builder
queryFactory(QueryFactory queryFactory)
Deprecated, for removal: This API element is subject to removal in a future version.MapperOptions.Builder
storeEmpties(boolean storeEmpties)
Deprecated, for removal: This API element is subject to removal in a future version.MapperOptions.Builder
storeNulls(boolean storeNulls)
Deprecated, for removal: This API element is subject to removal in a future version.MapperOptions.Builder
useLowerCaseCollectionNames(boolean useLowerCaseCollectionNames)
Deprecated, for removal: This API element is subject to removal in a future version.usecollectionNaming(NamingStrategy)
insteadMapperOptions.Builder
uuidRepresentation(UuidRepresentation uuidRepresentation)
Deprecated, for removal: This API element is subject to removal in a future version.This should be configured in the MongoClient given to Morphia
-
-
-
Method Detail
-
addConvention
public MapperOptions.Builder addConvention(MorphiaConvention convention)
Deprecated, for removal: This API element is subject to removal in a future version.Adds a custom convention to the list to be applied to all new MorphiaModels.- Parameters:
convention
- the new convention- Returns:
- this
- Since:
- 2.0
-
autoImportModels
public MapperOptions.Builder autoImportModels(boolean autoImportModels)
Deprecated, for removal: This API element is subject to removal in a future version.This feature automatically discovers and usesEntityModelImporter
instances to allow for external definition of class models. This feature defaults to true.- Parameters:
autoImportModels
- Set to true to auto import definitions viaEntityModelImporter
. Defaults to true.- Returns:
- this
-
build
public MapperOptions build()
Deprecated, for removal: This API element is subject to removal in a future version.- Returns:
- the new options instance
-
cacheClassLookups
public MapperOptions.Builder cacheClassLookups(boolean cacheClassLookups)
Deprecated, for removal: This API element is subject to removal in a future version.- Parameters:
cacheClassLookups
- if true class lookups are cached- Returns:
- this
-
classLoader
public MapperOptions.Builder classLoader(ClassLoader classLoader)
Deprecated, for removal: This API element is subject to removal in a future version.- Parameters:
classLoader
- the ClassLoader to use- Returns:
- this
-
codecProvider
@MorphiaExperimental public MapperOptions.Builder codecProvider(CodecProvider codecProvider)
Deprecated, for removal: This API element is subject to removal in a future version.Sets a provider for user defined codecs to used by Morphia- Parameters:
codecProvider
- the provider to user- Returns:
- this
- Since:
- 2.3
Developer note.This is an experimental item. Its function and presence are subject to change. Feedback on features and usability extremely welcome.
-
collectionNaming
public MapperOptions.Builder collectionNaming(NamingStrategy strategy)
Deprecated, for removal: This API element is subject to removal in a future version.Sets the naming strategy to use for collection names- Parameters:
strategy
- the strategy to use- Returns:
- this
-
dateForm
@Deprecated public MapperOptions.Builder dateForm(DateStorage dateStorage)
Deprecated.usedateStorage(DateStorage)
instead.- Parameters:
dateStorage
- the storage format to use for dates- Returns:
- this
-
dateStorage
public MapperOptions.Builder dateStorage(DateStorage dateStorage)
Deprecated, for removal: This API element is subject to removal in a future version.The default value for this isDateStorage.UTC
. To use theDateStorage.SYSTEM_DEFAULT
, either set this value explicitly here or use theMapperOptions.legacy()
Builder.- Parameters:
dateStorage
- the storage format to use for dates- Returns:
- this
- Since:
- 2.0
-
disableEmbeddedIndexes
@Deprecated(forRemoval=true) public MapperOptions.Builder disableEmbeddedIndexes(boolean disableEmbeddedIndexes)
Deprecated, for removal: This API element is subject to removal in a future version.unused- Parameters:
disableEmbeddedIndexes
- if true scanning @Embedded properties for indexing is disabled- Returns:
- this
-
discriminator
public MapperOptions.Builder discriminator(DiscriminatorFunction function)
Deprecated, for removal: This API element is subject to removal in a future version.Sets the discriminator function to use- Parameters:
function
- the function to use- Returns:
- this
-
discriminatorKey
public MapperOptions.Builder discriminatorKey(String key)
Deprecated, for removal: This API element is subject to removal in a future version.Defines the discriminator key name- Parameters:
key
- the key to use, e.g., "_t". the default/legacy value is "className"- Returns:
- this
-
enablePolymorphicQueries
public MapperOptions.Builder enablePolymorphicQueries(boolean enablePolymorphicQueries)
Deprecated, for removal: This API element is subject to removal in a future version.- Parameters:
enablePolymorphicQueries
- if true queries are updated, in some cases, to check for subtypes' discriminator values so that subtype might be returned by a query.- Returns:
- this
-
fieldNaming
@Deprecated(forRemoval=true) public MapperOptions.Builder fieldNaming(NamingStrategy strategy)
Deprecated, for removal: This API element is subject to removal in a future version.usepropertyNaming(NamingStrategy)
insteadSets the naming strategy to use for fields unless expliclity set via @Property- Parameters:
strategy
- the strategy to use- Returns:
- this
- See Also:
Property
-
ignoreFinals
public MapperOptions.Builder ignoreFinals(boolean ignoreFinals)
Deprecated, for removal: This API element is subject to removal in a future version.- Parameters:
ignoreFinals
- if true final fields are ignored- Returns:
- this
-
mapSubPackages
public MapperOptions.Builder mapSubPackages(boolean mapSubPackages)
Deprecated, for removal: This API element is subject to removal in a future version.- Parameters:
mapSubPackages
- if true subpackages are mapped when given a particular package- Returns:
- this
-
propertyDiscovery
@Deprecated(since="2.4", forRemoval=true) public MapperOptions.Builder propertyDiscovery(MapperOptions.PropertyDiscovery discovery)
Deprecated, for removal: This API element is subject to removal in a future version.3.0 will evaluate both field and getter/setters for annotation so this setting becomes vestigialDetermines how properties are discovered on mapped entities- Parameters:
discovery
- the discovery strategy to use- Returns:
- this
- Since:
- 2.2
-
propertyNaming
public MapperOptions.Builder propertyNaming(NamingStrategy strategy)
Deprecated, for removal: This API element is subject to removal in a future version.Sets the naming strategy to use for propertys unless expliclity set via @Property- Parameters:
strategy
- the strategy to use- Returns:
- this
- Since:
- 2.2
- See Also:
Property
-
queryFactory
public MapperOptions.Builder queryFactory(QueryFactory queryFactory)
Deprecated, for removal: This API element is subject to removal in a future version.- Parameters:
queryFactory
- the query factory to use when creating queries- Returns:
- this
-
storeEmpties
public MapperOptions.Builder storeEmpties(boolean storeEmpties)
Deprecated, for removal: This API element is subject to removal in a future version.- Parameters:
storeEmpties
- if true empty maps and collection types are stored in the database- Returns:
- this
-
storeNulls
public MapperOptions.Builder storeNulls(boolean storeNulls)
Deprecated, for removal: This API element is subject to removal in a future version.- Parameters:
storeNulls
- if true null values are stored in the database- Returns:
- this
-
useLowerCaseCollectionNames
@Deprecated(since="2.0", forRemoval=true) public MapperOptions.Builder useLowerCaseCollectionNames(boolean useLowerCaseCollectionNames)
Deprecated, for removal: This API element is subject to removal in a future version.usecollectionNaming(NamingStrategy)
instead- Parameters:
useLowerCaseCollectionNames
- if true, generated collections names are lower cased- Returns:
- this
-
uuidRepresentation
@Deprecated(forRemoval=true, since="2.3") public MapperOptions.Builder uuidRepresentation(UuidRepresentation uuidRepresentation)
Deprecated, for removal: This API element is subject to removal in a future version.This should be configured in the MongoClient given to MorphiaConfigures the UUID representation to use- Parameters:
uuidRepresentation
- the representation- Returns:
- this
-
-