Package com.impetus.kundera.tests.crossdatastore.useraddress.entities

Examples of com.impetus.kundera.tests.crossdatastore.useraddress.entities.PersonnelUniMToM


    }

    @Override
    protected void insert()
    {
        PersonnelUniMToM person1 = new PersonnelUniMToM();
        person1.setPersonId("unimanytomany_1");
        person1.setPersonName("Amresh");

        PersonnelUniMToM person2 = new PersonnelUniMToM();
        person2.setPersonId("unimanytomany_2");
        person2.setPersonName("Vivek");

        HabitatUniMToM address1 = new HabitatUniMToM();
        address1.setAddressId("unimanytomany_a");
        address1.setStreet("AAAAAAAAAAAAA");

        HabitatUniMToM address2 = new HabitatUniMToM();
        address2.setAddressId("unimanytomany_b");
        address2.setStreet("BBBBBBBBBBBBBBB");

        HabitatUniMToM address3 = new HabitatUniMToM();
        address3.setAddressId("unimanytomany_c");
        address3.setStreet("CCCCCCCCCCC");

        Set<HabitatUniMToM> person1Addresses = new HashSet<HabitatUniMToM>();
        Set<HabitatUniMToM> person2Addresses = new HashSet<HabitatUniMToM>();

        person1Addresses.add(address1);
        person1Addresses.add(address2);

        person2Addresses.add(address2);
        person2Addresses.add(address3);

        person1.setAddresses(person1Addresses);
        person2.setAddresses(person2Addresses);

        Set<PersonnelUniMToM> persons = new HashSet<PersonnelUniMToM>();
        persons.add(person1);
        persons.add(person2);
View Full Code Here


    @Override
    protected void find()
    {

        PersonnelUniMToM person1 = (PersonnelUniMToM) dao.findPerson(PersonnelUniMToM.class, "unimanytomany_1");
        assertPerson1(person1);

        PersonnelUniMToM person2 = (PersonnelUniMToM) dao.findPerson(PersonnelUniMToM.class, "unimanytomany_2");
        assertPerson2(person2);
    }
View Full Code Here

    @Override
    protected void findPersonByIdColumn()
    {
        // Find Person 1
        PersonnelUniMToM p1 = (PersonnelUniMToM) dao.findPersonByIdColumn(PersonnelUniMToM.class, "unimanytomany_1");
        assertPerson1(p1);

        // Find Person 2
        PersonnelUniMToM p2 = (PersonnelUniMToM) dao.findPersonByIdColumn(PersonnelUniMToM.class, "unimanytomany_2");
        assertPerson2(p2);
    }
View Full Code Here

    }

    @Override
    protected void update()
    {
        PersonnelUniMToM p1 = (PersonnelUniMToM) dao.findPerson(PersonnelUniMToM.class, "unimanytomany_1");
        Assert.assertNotNull(p1);
        Assert.assertEquals(2, p1.getAddresses().size());
        for (HabitatUniMToM address : p1.getAddresses())
        {
            address.setStreet("Brand New Street");
        }
        p1.setPersonName("Saurabh");
        dao.merge(p1);
        PersonnelUniMToM p1AfterMerge = (PersonnelUniMToM) dao.findPerson(PersonnelUniMToM.class, "unimanytomany_1");
        Assert.assertNotNull(p1AfterMerge);
        Assert.assertEquals("Saurabh", p1AfterMerge.getPersonName());
        Assert.assertEquals(2, p1AfterMerge.getAddresses().size());
        for (HabitatUniMToM address : p1AfterMerge.getAddresses())
        {
            Assert.assertEquals("Brand New Street", address.getStreet());
        }

        PersonnelUniMToM p2 = (PersonnelUniMToM) dao.findPerson(PersonnelUniMToM.class, "unimanytomany_2");
        Assert.assertNotNull(p2);
        Assert.assertEquals(2, p2.getAddresses().size());
        p2.setPersonName("Vijay");
        for (HabitatUniMToM address : p2.getAddresses())
        {
            address.setStreet("Brand New Street");
        }
        dao.merge(p2);
        PersonnelUniMToM p2AfterMerge = (PersonnelUniMToM) dao.findPerson(PersonnelUniMToM.class, "unimanytomany_2");
        Assert.assertNotNull(p2AfterMerge);
        Assert.assertEquals("Vijay", p2AfterMerge.getPersonName());
        Assert.assertEquals(2, p2AfterMerge.getAddresses().size());
        for (HabitatUniMToM address : p2AfterMerge.getAddresses())
        {
            Assert.assertEquals("Brand New Street", address.getStreet());
        }
    }
View Full Code Here

    @Override
    protected void remove()
    {
        dao.remove("unimanytomany_1", PersonnelUniMToM.class);
        PersonnelUniMToM person1AfterRemoval = (PersonnelUniMToM) dao.findPerson(PersonnelUniMToM.class,
                "unimanytomany_1");
        Assert.assertNull(person1AfterRemoval);

        dao.remove("unimanytomany_2", PersonnelUniMToM.class);
        PersonnelUniMToM person2AfterRemoval = (PersonnelUniMToM) dao.findPerson(PersonnelUniMToM.class,
                "unimanytomany_2");
        Assert.assertNull(person2AfterRemoval);
    }
View Full Code Here

TOP

Related Classes of com.impetus.kundera.tests.crossdatastore.useraddress.entities.PersonnelUniMToM

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.