Package org.kiwiproject.spring.data
Class KiwiMongoConverters
java.lang.Object
org.kiwiproject.spring.data.KiwiMongoConverters
A few utilities related to Spring Data Mongo and custom
Converters.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classAConverterthat maps from the JS 'undefined' type to a 'null' value. -
Method Summary
Modifier and TypeMethodDescriptionstatic org.springframework.data.mongodb.core.MongoTemplateaddCustomConverters(org.springframework.data.mongodb.core.MongoTemplate template, org.springframework.core.convert.converter.Converter<?, ?>... converters) Adds one or more custom converters to aMongoTemplateinstance.static org.springframework.core.convert.converter.Converter<org.bson.BsonUndefined,String> Create a newKiwiMongoConverters.BsonUndefinedToNullStringConverter.
-
Method Details
-
newBsonUndefinedToNullObjectConverter
public static org.springframework.core.convert.converter.Converter<org.bson.BsonUndefined,String> newBsonUndefinedToNullObjectConverter()Create a newKiwiMongoConverters.BsonUndefinedToNullStringConverter.- Returns:
- new BsonUndefinedToNullStringConverter instance
-
addCustomConverters
public static org.springframework.data.mongodb.core.MongoTemplate addCustomConverters(org.springframework.data.mongodb.core.MongoTemplate template, org.springframework.core.convert.converter.Converter<?, ?>... converters) Adds one or more custom converters to aMongoTemplateinstance.The MongoTemplate is assumed to have a
Converterof typeMappingMongoConverter.- Parameters:
template- the MongoTemplateconverters- the converters to add to MongoTemplate's existing converter- Returns:
- the template instance, for method chaining
- Throws:
IllegalArgumentException- if the given MongoTemplate'sConverteris not aMappingMongoConverter- See Also:
-
AbstractMongoConverter.setCustomConversions(CustomConversions)
-