Package org.mongodb.morphia.testmodel

Examples of org.mongodb.morphia.testmodel.Rectangle


    @Test
    public void testKeyAsId() throws Exception {
        getMorphia().map(KeyAsId.class);

        final Rectangle r = new Rectangle(1, 1);
        //        Rectangle r2 = new Rectangle(11,11);

        final Key<Rectangle> rKey = getDs().save(r);
        //        Key<Rectangle> r2Key = ds.save(r2);
        final KeyAsId kai = new KeyAsId(rKey);
View Full Code Here


        assertNotNull(maiKey);
    }

    @Test
    public void testIdFieldNameMapping() throws Exception {
        final Rectangle r = new Rectangle(1, 12);
        final BasicDBObject dbObj = (BasicDBObject) getMorphia().toDBObject(r);
        assertFalse(dbObj.containsField("id"));
        assertTrue(dbObj.containsField(Mapper.ID_KEY));
        assertEquals(4, dbObj.size()); //_id, h, w, className
    }
View Full Code Here

TOP

Related Classes of org.mongodb.morphia.testmodel.Rectangle

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.