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

Examples of org.springframework.data.mongodb.core.convert.MappingMongoConverter.afterPropertiesSet()


    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;
  }

  private DBObject getMappedSortObject(Query query, Class<?> type) {
View Full Code Here

    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);
  }

  @Before
  public void setUp() {
View Full Code Here

    when(mappingContextMock.getPersistentEntity(Matchers.any(Class.class))).thenReturn(persitentEntityMock);
    when(persitentEntityMock.getType()).thenReturn(Person.class);

    DbRefResolver dbRefResolver = new DefaultDbRefResolver(mock(MongoDbFactory.class));
    MappingMongoConverter converter = new MappingMongoConverter(dbRefResolver, mappingContextMock);
    converter.afterPropertiesSet();

    when(mongoOperationsMock.getConverter()).thenReturn(converter);
  }

  /**
 
View Full Code Here

    mappingContext.initialize();

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

    this.mappingTemplate = new MongoTemplate(factory, mappingConverter);
  }

  @Before
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.