Package org.springframework.data.mongodb.core.convert

Examples of org.springframework.data.mongodb.core.convert.MappingMongoConverter$MongoDbPropertyValueProvider


        return new MongoMappingContext();
    }

    @Bean
    public MappingMongoConverter mongoConverter() throws UnknownHostException {
        MappingMongoConverter converter = new MappingMongoConverter(mongoDbFactory(), mongoMappingContext());
        converter.setTypeMapper(mongoTypeMapper());
        return converter;
    }
View Full Code Here


    @Override
    public MappingMongoConverter mappingMongoConverter() throws Exception {
        // We provide custom conversions for some value objects so that the resulting serialized json looks nicer,
        // is more readable, and is smaller.
        MappingMongoConverter mappingMongoConverter = super.mappingMongoConverter();
        List<Converter<?,?>> converters = new ArrayList<Converter<?,?>>();
        converters.add(new ProjectIdReadConverter());
        converters.add(new ProjectIdWriteConverter());
        converters.add(new UserIdReadConverter());
        converters.add(new UserIdWriteConverter());
        converters.add(new EmailAddressReadConverter());
        converters.add(new EmailAddressWriteConverter());

        mappingMongoConverter.setCustomConversions(new CustomConversions(converters));
        return mappingMongoConverter;
    }
View Full Code Here

        return new MongoMappingContext();
    }

    @Bean
    public MappingMongoConverter mongoConverter() throws UnknownHostException {
        MappingMongoConverter converter = new MappingMongoConverter(mongoDbFactory(), mongoMappingContext());
        converter.setTypeMapper(mongoTypeMapper());
        return converter;
    }
View Full Code Here

  @Before
  public void setUp() {

    MongoTemplate template = new MongoTemplate(factory);
    MappingMongoConverter converter = new MappingMongoConverter(new DefaultDbRefResolver(factory),
        new MongoMappingContext());

    this.callback = template.new UnwrapAndReadDbObjectCallback<Target>(converter, Target.class);
  }
View Full Code Here

   */
  @Bean
  public MappingMongoConverter mappingMongoConverter() throws Exception {

    DbRefResolver dbRefResolver = new DefaultDbRefResolver(mongoDbFactory());
    MappingMongoConverter converter = new MappingMongoConverter(dbRefResolver, mongoMappingContext());
    converter.setCustomConversions(customConversions());

    return converter;
  }
View Full Code Here

    MongoMappingContext mappingContext = new MongoMappingContext();
    mappingContext.setInitialEntitySet(new HashSet<Class<?>>(Arrays.asList(XObject.class)));
    mappingContext.initialize();

    DbRefResolver dbRefResolver = new DefaultDbRefResolver(factory);
    MappingMongoConverter mappingConverter = new MappingMongoConverter(dbRefResolver, mappingContext);
    mappingConverter.afterPropertiesSet();

    this.mongoTemplate = new MongoTemplate(factory, mappingConverter);
    mongoTemplate.setApplicationContext(applicationContext);
  }
View Full Code Here

  }

  private static final MongoConverter getDefaultMongoConverter(MongoDbFactory factory) {

    DbRefResolver dbRefResolver = new DefaultDbRefResolver(factory);
    MappingMongoConverter converter = new MappingMongoConverter(dbRefResolver, new MongoMappingContext());
    converter.afterPropertiesSet();
    return converter;
  }
View Full Code Here

    MongoMappingContext mappingContext = new MongoMappingContext();
    mappingContext.setInitialEntitySet(new HashSet<Class<?>>(Arrays.asList(ValueObject.class)));
    mappingContext.initialize();

    DbRefResolver dbRefResolver = new DefaultDbRefResolver(factory);
    MappingMongoConverter mappingConverter = new MappingMongoConverter(dbRefResolver, mappingContext);
    mappingConverter.afterPropertiesSet();
    this.mongoTemplate = new MongoTemplate(factory, mappingConverter);
  }
View Full Code Here

  @Before
  public void setUp() {

    when(operations.getConverter()).thenReturn(converter);

    this.converter = new MappingMongoConverter(factory, new MongoMappingContext());
  }
View Full Code Here

  @Before
  public void setUp() {

    this.context = new MongoMappingContext();
    this.resolver = new DefaultDbRefResolver(factory);
    this.converter = new MappingMongoConverter(resolver, context);
  }
View Full Code Here

TOP

Related Classes of org.springframework.data.mongodb.core.convert.MappingMongoConverter$MongoDbPropertyValueProvider

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.