Package org.jongo.marshall.jackson.configuration

Examples of org.jongo.marshall.jackson.configuration.Mapping


    public void setUp() throws Exception {
        ObjectMapper mapper = new ObjectMapper(MongoBsonFactory.createFactory());
        Mapping.Builder builder = new Mapping.Builder(mapper);
        builder.registerModule(new BsonModule());
        builder.addModifier(new PropertyModifier());
        Mapping mapping = builder.build();
        projection = new JacksonProjection(mapper);
    }
View Full Code Here


import static org.jongo.util.BsonUtil.bsonify;

public class JacksonViewTest {

    private JacksonEngine createProcessorWithView(final Class<?> viewClass) {
        Mapping mapping = new Mapping.Builder().withView(viewClass).build();
        return new JacksonEngine(mapping);
    }
View Full Code Here

    }

    @Test
    public void canHandleObjectSerializedAsAPrimitive() throws Exception {

        Mapping mapping = new Mapping.Builder().addSerializer(Friend.class, new PrimitiveJsonSerializer()).build();
        factory = new BsonQueryFactory(new JacksonEngine(mapping));

        DBObject query = factory.createQuery("{bytes:#}", new Friend("Robert")).toDBObject();

        assertThat(query.get("bytes")).isEqualTo("Robert");
View Full Code Here

TOP

Related Classes of org.jongo.marshall.jackson.configuration.Mapping

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.