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

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


  @Test
  public void shouldBeAbleToConfigureCustomTypeMapperViaJavaConfig() {

    AbstractApplicationContext context = new AnnotationConfigApplicationContext(SampleMongoConfiguration.class);
    MongoTypeMapper typeMapper = context.getBean(CustomMongoTypeMapper.class);
    MappingMongoConverter mmc = context.getBean(MappingMongoConverter.class);

    assertThat(mmc, is(notNullValue()));
    assertThat(mmc.getTypeMapper(), is(typeMapper));
    context.close();
  }
View Full Code Here


    }

    @Bean
    @Override
    public MappingMongoConverter mappingMongoConverter() throws Exception {
      MappingMongoConverter mmc = super.mappingMongoConverter();
      mmc.setTypeMapper(typeMapper());
      return mmc;
    }
View Full Code Here

    when(metadataMock.getDomainType()).thenReturn((Class) Person.class);
    when(metadataMock.getReturnedDomainClass(Matchers.any(Method.class))).thenReturn((Class) Person.class);
    mappingContext = new MongoMappingContext();
    DbRefResolver dbRefResolver = new DefaultDbRefResolver(mock(MongoDbFactory.class));
    MongoConverter converter = new MappingMongoConverter(dbRefResolver, mappingContext);

    when(mongoOperationsMock.getConverter()).thenReturn(converter);
  }
View Full Code Here

    context = new MongoMappingContext();
    context.setInitialEntitySet(Collections.singleton(StringWrapper.class));
    context.initialize();

    converter = new MappingMongoConverter(resolver, context);
  }
View Full Code Here

    when(cursor.limit(anyInt())).thenReturn(cursor);
    when(cursor.sort(Mockito.any(DBObject.class))).thenReturn(cursor);
    when(cursor.hint(anyString())).thenReturn(cursor);

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

    MongoMappingContext context = new MongoMappingContext();
    context.setInitialEntitySet(Collections.singleton(Person.class));
    context.afterPropertiesSet();

    this.converter = new MappingMongoConverter(new DefaultDbRefResolver(mongoDbFactory), context);
    this.operations = new MongoTemplate(new SimpleMongoDbFactory(this.mongo, DATABASE_NAME), converter);

    MongoRepositoryFactoryBean<PersonRepository, Person, ObjectId> factory = new MongoRepositoryFactoryBean<PersonRepository, Person, ObjectId>();
    factory.setMongoOperations(operations);
    factory.setRepositoryInterface(PersonRepository.class);
View Full Code Here

TOP

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

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.