Package com.impetus.client.entities

Examples of com.impetus.client.entities.PersonOTORedis


    public void testCrud()
    {
        logger.info("On crud over association ");
        EntityManager em = emf.createEntityManager();

        PersonOTORedis person = new PersonOTORedis(ROW_KEY);
        person.setAge(32);
        person.setPersonName("vivek");
        AddressOTORedis address = new AddressOTORedis(12.23);
        address.setAddress("india");
        person.setAddress(address);
        em.persist(person);

        em.clear();
        PersonOTORedis p = em.find(PersonOTORedis.class, ROW_KEY);

        // Assertions.
        Assert.assertNotNull(p);
        Assert.assertEquals(person.getPersonId(), p.getPersonId());
        Assert.assertNotNull(p.getAddress());
        Assert.assertEquals(person.getAddress().getAddress(), p.getAddress().getAddress());

        // Remove
        em.remove(p);

        em.clear(); // clear cache
View Full Code Here

TOP

Related Classes of com.impetus.client.entities.PersonOTORedis

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.