Package com.impetus.client.oraclenosql.entities

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


        Set<AddressOracleNoSqlOTM> addresses = new HashSet<AddressOracleNoSqlOTM>();
        addresses.add(address1);
        addresses.add(address2);

        PersonOracleNoSqlOTM person = new PersonOracleNoSqlOTM();
        person.setPersonId("1");
        person.setPersonName("Kuldeep");
        person.setAddresses(addresses);

        em.persist(person);

        em = getNewEM();

        PersonOracleNoSqlOTM foundPerson = em.find(PersonOracleNoSqlOTM.class, "1");
        Assert.assertNotNull(foundPerson);
        Assert.assertNotNull(foundPerson.getAddresses());
        Assert.assertEquals("1", foundPerson.getPersonId());
        Assert.assertEquals("Kuldeep", foundPerson.getPersonName());

        int counter = 0;
        for (AddressOracleNoSqlOTM address : foundPerson.getAddresses()) {
            if (address.getAddressId().equals("a")) {
                counter++;
                Assert.assertEquals("sector 11", address.getStreet());
            } else {
                Assert.assertEquals("b", address.getAddressId());
                Assert.assertEquals("sector 12", address.getStreet());
                counter++;
            }
        }

        Assert.assertEquals(2, counter);

        foundPerson.setPersonName("KK");

        em.merge(foundPerson);

        em = getNewEM();

        foundPerson = em.find(PersonOracleNoSqlOTM.class, "1");
        Assert.assertNotNull(foundPerson);
        Assert.assertNotNull(foundPerson.getAddresses());
        Assert.assertEquals("1", foundPerson.getPersonId());
        Assert.assertEquals("KK", foundPerson.getPersonName());

        counter = 0;
        for (AddressOracleNoSqlOTM address : foundPerson.getAddresses()) {
            if (address.getAddressId().equals("a")) {
                counter++;
                Assert.assertEquals("sector 11", address.getStreet());
            } else {
                Assert.assertEquals("b", address.getAddressId());
View Full Code Here


        Set<AddressOracleNoSqlOTM> addresses = new HashSet<AddressOracleNoSqlOTM>();
        addresses.add(address1);
        addresses.add(address2);

        PersonOracleNoSqlOTM person = new PersonOracleNoSqlOTM();
        person.setPersonId("1");
        person.setPersonName("Kuldeep");
        person.setAddresses(addresses);

        em.persist(person);

        AddressOracleNoSqlOTM address1a = new AddressOracleNoSqlOTM();
        address1a.setAddressId("a1");
        address1a.setStreet("sector 11a");

        AddressOracleNoSqlOTM address2b = new AddressOracleNoSqlOTM();
        address2b.setAddressId("b1");
        address2b.setStreet("sector 12b");

        Set<AddressOracleNoSqlOTM> addresses1 = new HashSet<AddressOracleNoSqlOTM>();
        addresses1.add(address1a);
        addresses1.add(address2b);

        PersonOracleNoSqlOTM person1 = new PersonOracleNoSqlOTM();
        person1.setPersonId("2");
        person1.setPersonName("KK");
        person1.setAddresses(addresses1);

        em.persist(person1);

        em = getNewEM();
View Full Code Here

TOP

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

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.