Examples of FakeAggregateWithSubclassMapping


Examples of org.mongolink.test.inheritanceMapping.FakeAggregateWithSubclassMapping

public class TestsMongoSessionWithInheritance {

    @Before
    public void before() {
        db = new Fongo("test").getDB("test");
        FakeAggregateWithSubclassMapping mapping = new FakeAggregateWithSubclassMapping();
        session = new MongoSessionImpl(db, new CriteriaFactory());
        MapperContext context = new MapperContext();
        mapping.buildMapper(context);
        session.setMappingContext(context);
        session.start();
    }
View Full Code Here

Examples of org.mongolink.test.inheritanceMapping.FakeAggregateWithSubclassMapping

    }

    @Test
    public void canCreateInstanceGivenDiscriminatorValue() {
        MapperContext context = new MapperContext();
        new FakeAggregateWithSubclassMapping().buildMapper(context);
        ClassMapper<FakeAggregate> entityMapper = context.mapperFor(FakeAggregate.class);
        BasicDBObject dbo = new BasicDBObject();
        dbo.put("_id", "1");
        dbo.put("__discriminator", "FakeChildAggregate");
View Full Code Here

Examples of org.mongolink.test.inheritanceMapping.FakeAggregateWithSubclassMapping

    }

    @Test
    public void createParentEntityWhenNoDiscriminatorGiven() {
        MapperContext context = new MapperContext();
        new FakeAggregateWithSubclassMapping().buildMapper(context);
        ClassMapper<FakeAggregate> entityMapper = context.mapperFor(FakeAggregate.class);
        BasicDBObject dbo = new BasicDBObject();
        dbo.put("_id", "1");

        FakeAggregate instance = entityMapper.toInstance(dbo);
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.