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

Examples of org.springframework.data.mongodb.core.convert.QueryMapper$AssociationConverter


    Assert.notNull(mongoDbFactory);

    this.mongoDbFactory = mongoDbFactory;
    this.exceptionTranslator = mongoDbFactory.getExceptionTranslator();
    this.mongoConverter = mongoConverter == null ? getDefaultMongoConverter(mongoDbFactory) : mongoConverter;
    this.queryMapper = new QueryMapper(this.mongoConverter);
    this.updateMapper = new UpdateMapper(this.mongoConverter);

    // We always have a mapping context in the converter, whether it's a simple one or not
    mappingContext = this.mongoConverter.getMappingContext();
    // We create indexes based on mapping events
View Full Code Here


    this.dbFactory = dbFactory;
    this.converter = converter;
    this.bucket = bucket;

    this.queryMapper = new QueryMapper(converter);
  }
View Full Code Here

    Assert.notNull(converter, "MongoConverter must not be null!");

    this.mappingContext = converter.getMappingContext();
    this.converter = converter;
    this.mapper = new QueryMapper(converter);
  }
View Full Code Here

  @Before
  public void setUp() {

    this.context = new MongoMappingContext();
    this.converter = new MappingMongoConverter(dbRefResolver, context);
    this.mapper = new QueryMapper(converter);
  }
View Full Code Here

  @Test
  public void shouldConvertCompoundExpressionToPropertyPath() {

    MappingMongoConverter converter = new MappingMongoConverter(dbRefResolver, new MongoMappingContext());
    TypeBasedAggregationOperationContext ctxt = new TypeBasedAggregationOperationContext(Data.class,
        new MongoMappingContext(), new QueryMapper(converter));
    assertThat(transformer.transform("item.primitiveIntValue", ctxt, new Object[0]).toString(),
        is("$item.primitiveIntValue"));
  }
View Full Code Here

    exception.expect(MappingException.class);
    exception.expectMessage("value2");

    MappingMongoConverter converter = new MappingMongoConverter(dbRefResolver, new MongoMappingContext());
    TypeBasedAggregationOperationContext ctxt = new TypeBasedAggregationOperationContext(Data.class,
        new MongoMappingContext(), new QueryMapper(converter));
    assertThat(transformer.transform("item.value2", ctxt, new Object[0]).toString(), is("$item.value2"));
  }
View Full Code Here

    Query query = new Query();
    Update update = new Update().set("foo", new AutogenerateableId());

    template.updateFirst(query, update, Wrapper.class);

    QueryMapper queryMapper = new QueryMapper(converter);
    DBObject reference = queryMapper.getMappedObject(update.getUpdateObject(), null);

    verify(collection, times(1)).update(Mockito.any(DBObject.class), eq(reference), anyBoolean(), anyBoolean());
  }
View Full Code Here

TOP

Related Classes of org.springframework.data.mongodb.core.convert.QueryMapper$AssociationConverter

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.