All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.zodiac.autoconfigure.mongo.MongoAutoConfiguration Maven / Gradle / Ivy

There is a newer version: 1.6.8
Show newest version
package org.zodiac.autoconfigure.mongo;

import org.springframework.boot.SpringBootConfiguration;
import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.context.annotation.Bean;
import org.springframework.core.convert.converter.Converter;
import org.springframework.data.mongodb.core.convert.MongoCustomConversions;
import org.zodiac.commons.util.Colls;
import org.zodiac.mongo.converter.DBObjectToJsonNodeConverter;
import org.zodiac.mongo.converter.JsonNodeToDocumentConverter;

import java.util.List;

@SpringBootConfiguration
@ConditionalOnClass(name = {"com.mongodb.MongoClient"})
@AutoConfigureAfter(value = {org.springframework.boot.autoconfigure.mongo.MongoAutoConfiguration.class})
public class MongoAutoConfiguration {

    @Bean
    protected MongoCustomConversions customConversions() {
        List> converters = Colls.list(DBObjectToJsonNodeConverter.INSTANCE, JsonNodeToDocumentConverter.INSTANCE);
        return new MongoCustomConversions(converters);
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy