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
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description static MapperOptions.Builder
builder()
static MapperOptions.Builder
builder(MapperOptions original)
ClassLoader
getClassLoader()
Returns the classloader used, in theory, when loading the entity types.NamingStrategy
getCollectionNaming()
List<MorphiaConvention>
getConventions()
DateStorage
getDateStorage()
DiscriminatorFunction
getDiscriminator()
String
getDiscriminatorKey()
NamingStrategy
getFieldNaming()
Deprecated, for removal: This API element is subject to removal in a future version.usegetPropertyNaming()
insteadNamingStrategy
getPropertyNaming()
QueryFactory
getQueryFactory()
org.bson.UuidRepresentation
getUuidRepresentation()
boolean
isCacheClassLookups()
boolean
isEnablePolymorphicQueries()
boolean
isIgnoreFinals()
boolean
isMapSubPackages()
boolean
isStoreEmpties()
boolean
isStoreNulls()
static MapperOptions.Builder
legacy()
-
-
-
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
public static MapperOptions.Builder legacy()
- Returns:
- a builder to set mapping options
-
getClassLoader
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
public org.bson.UuidRepresentation getUuidRepresentation()
- 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
-
-