Package dev.morphia.mapping
Class MapperOptions
- java.lang.Object
-
- dev.morphia.mapping.MapperOptions
-
public class MapperOptions extends Object
Options to control mapping behavior.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MapperOptions.Builder
A builder class for setting mapping optionsstatic class
MapperOptions.PropertyDiscovery
-
Field Summary
Fields Modifier and Type Field Description static MapperOptions
DEFAULT
-
Method Summary
-
-
-
Field Detail
-
DEFAULT
public static final MapperOptions DEFAULT
-
-
Method Detail
-
builder
public static MapperOptions.Builder builder()
- Returns:
- a builder to set mapping options
-
builder
public static MapperOptions.Builder builder(MapperOptions original)
- Parameters:
original
- an existing set of options to use as a starting point- Returns:
- a builder to set mapping options
-
legacy
@Deprecated public static MapperOptions.Builder legacy()
Deprecated.See the upgrading instructions on the website.- Returns:
- a builder to set mapping options
-
autoImportModels
@MorphiaInternal public boolean autoImportModels()
- Returns:
- true if
EntityModelImporter
instances should be loaded - Since:
- 2.3
Developer note.This is an internal item. Its function and presence are subject to change without warning. Its use is highly discouraged.
-
codecProvider
@Nullable @MorphiaInternal public CodecProvider codecProvider()
- Returns:
- the configured CodecProvider
- Since:
- 2.3
- See Also:
CodecProvider
-
getClassLoader
@MorphiaInternal public ClassLoader getClassLoader()
Returns the classloader used, in theory, when loading the entity types.- Returns:
- the classloader
Developer note.This is an internal item. Its function and presence are subject to change without warning. Its use is highly discouraged.
-
getCollectionNaming
public NamingStrategy getCollectionNaming()
- Returns:
- the naming strategy for collections unless explicitly set via @Entity
- See Also:
Entity
-
getConventions
public List<MorphiaConvention> getConventions()
- Returns:
- the configured Conventions
-
getDateStorage
public DateStorage getDateStorage()
- Returns:
- the date storage configuration value
-
getDiscriminator
public DiscriminatorFunction getDiscriminator()
- Returns:
- the function to determine discriminator value
-
getDiscriminatorKey
public String getDiscriminatorKey()
- Returns:
- the discriminator property name
-
getFieldNaming
@Deprecated(forRemoval=true) public NamingStrategy getFieldNaming()
Deprecated, for removal: This API element is subject to removal in a future version.usegetPropertyNaming()
instead- Returns:
- the naming strategy for properties unless explicitly set via @Property
- See Also:
Property
-
getPropertyNaming
public NamingStrategy getPropertyNaming()
- Returns:
- the naming strategy for properties unless explicitly set via @Property
- Since:
- 2.2
- See Also:
Property
-
getQueryFactory
public QueryFactory getQueryFactory()
- Returns:
- the query factory used by the Datastore
- Since:
- 2.0
-
getUuidRepresentation
@Deprecated(forRemoval=true, since="2.3") public UuidRepresentation getUuidRepresentation()
Deprecated, for removal: This API element is subject to removal in a future version.This should be configured in the MongoClient given to Morphia- Returns:
- the UUID representation to use in the driver
-
isCacheClassLookups
public boolean isCacheClassLookups()
- Returns:
- true if Morphia should cache name to Class lookups
-
isEnablePolymorphicQueries
public boolean isEnablePolymorphicQueries()
- Returns:
- true if polymorphic queries are enabled
-
isIgnoreFinals
public boolean isIgnoreFinals()
- Returns:
- true if Morphia should ignore final fields
-
isMapSubPackages
public boolean isMapSubPackages()
- Returns:
- true if Morphia should map classes from the sub-packages as well
-
isStoreEmpties
public boolean isStoreEmpties()
- Returns:
- true if Morphia should store empty values for lists/maps/sets/arrays
-
isStoreNulls
public boolean isStoreNulls()
- Returns:
- true if Morphia should store null values
-
-