Package com.impetus.client.oraclenosql.entities

Examples of com.impetus.client.oraclenosql.entities.PersonOracleNoSqlOTO


    public void testCRUD() {
        AddressOracleNoSqlOTO address = new AddressOracleNoSqlOTO();
        address.setAddressId("a");
        address.setStreet("sector 11");

        PersonOracleNoSqlOTO person = new PersonOracleNoSqlOTO();
        person.setPersonId("1");
        person.setPersonName("Kuldeep");
        person.setAddress(address);

        em.persist(person);

        em = getNewEM();

        PersonOracleNoSqlOTO foundPerson = em.find(PersonOracleNoSqlOTO.class, "1");
        Assert.assertNotNull(foundPerson);
        Assert.assertNotNull(foundPerson.getAddress());
        Assert.assertEquals("1", foundPerson.getPersonId());
        Assert.assertEquals("Kuldeep", foundPerson.getPersonName());
        Assert.assertEquals("a", foundPerson.getAddress().getAddressId());
        Assert.assertEquals("sector 11", foundPerson.getAddress().getStreet());

        foundPerson.setPersonName("KK");
        foundPerson.getAddress().setStreet("sector 12");

        em.merge(foundPerson);

        em = getNewEM();

        foundPerson = em.find(PersonOracleNoSqlOTO.class, "1");
        Assert.assertNotNull(foundPerson);
        Assert.assertNotNull(foundPerson.getAddress());
        Assert.assertEquals("1", foundPerson.getPersonId());
        Assert.assertEquals("KK", foundPerson.getPersonName());
        Assert.assertEquals("a", foundPerson.getAddress().getAddressId());
        Assert.assertEquals("sector 12", foundPerson.getAddress().getStreet());

        em.remove(foundPerson);
        foundPerson = em.find(PersonOracleNoSqlOTO.class, "1");
        Assert.assertNull(foundPerson);
View Full Code Here


        AddressOracleNoSqlOTO address1 = new AddressOracleNoSqlOTO();
        address1.setAddressId("a1");
        address1.setStreet("sector 12");

        PersonOracleNoSqlOTO person = new PersonOracleNoSqlOTO();
        person.setPersonId("1");
        person.setPersonName("Kuldeep");
        person.setAddress(address);

        PersonOracleNoSqlOTO person1 = new PersonOracleNoSqlOTO();
        person1.setPersonId("2");
        person1.setPersonName("KK");
        person1.setAddress(address1);
        em.persist(person1);

        em.persist(person);

        em = getNewEM();
View Full Code Here

TOP

Related Classes of com.impetus.client.oraclenosql.entities.PersonOracleNoSqlOTO

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.