Package org.jongo.model

Examples of org.jongo.model.Animal


    @Test
    public void canFindInheritedEntity() throws IOException {
        collection.save(new Fox("fantastic", "roux"));

        Animal animal = collection.findOne("{name:'fantastic'}").as(Animal.class);

        assertThat(animal).isInstanceOf(Fox.class);
        assertThat(animal.getId()).isNotNull();
    }
View Full Code Here


        Fox fox = new Fox("fantastic", "roux");

        collection.save(fox);

        Animal result = collection.findOne().as(Fox.class);
        assertThat(fox.getId()).isNotNull();
        assertThat(result.getId()).isEqualTo(fox.getId());
    }
View Full Code Here

TOP

Related Classes of org.jongo.model.Animal

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.