public interface MongoConverter extends EntityConverter<MongoPersistentEntity<?>,MongoPersistentProperty,Object,org.bson.conversions.Bson>, MongoWriter<Object>, EntityReader<Object,org.bson.conversions.Bson>
MongoWriter and EntityReader.| Modifier and Type | Method and Description |
|---|---|
default Object |
convertId(Object id,
Class<?> targetType)
Converts the given raw id value into either
ObjectId or String. |
MongoTypeMapper |
getTypeMapper()
Returns the
TypeMapper being used to write type information into Documents created with that
converter. |
default <S,T> T |
mapValueToTargetType(S source,
Class<T> targetType,
DbRefResolver dbRefResolver)
Mapping function capable of converting values into a desired target type by eg. extracting the actual java type
from a given
BsonValue. |
getConversionService, getMappingContextreadconvertToMongoType, convertToMongoType, convertToMongoType, toDBRefwriteMongoTypeMapper getTypeMapper()
TypeMapper being used to write type information into Documents created with that
converter.@Nullable default <S,T> T mapValueToTargetType(S source, Class<T> targetType, DbRefResolver dbRefResolver)
BsonValue.S - T - targetType - must not be null.dbRefResolver - must not be null.Function.IllegalArgumentException - if targetType is null.Copyright © 2011–2022 Pivotal Software, Inc.. All rights reserved.