Package org.mongodb.morphia.entities

Examples of org.mongodb.morphia.entities.IndexOnValue


    @Test
    public void testIndexedEntity() throws Exception {
        getDs().ensureIndexes();
        assertThat(getDs().getCollection(IndexOnValue.class).getIndexInfo(), hasIndexNamed("value_1"));

        getDs().save(new IndexOnValue());
        getDs().ensureIndexes();
        assertThat(getDs().getCollection(IndexOnValue.class).getIndexInfo(), hasIndexNamed("value_1"));
    }
View Full Code Here


        getMorphia().map(IndexOnValue.class, NoIndexes.class);
        Datastore ds = getDs();

        // when
        ds.ensureIndexes();
        ds.save(new IndexOnValue());
        ds.save(new NoIndexes());

        // then
        List<DBObject> indexes = getDb().getCollection("NoIndexes").getIndexInfo();
        assertEquals(1, indexes.size());
View Full Code Here

TOP

Related Classes of org.mongodb.morphia.entities.IndexOnValue

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.