Package com.impetus.kundera.polyglot.entities

Examples of com.impetus.kundera.polyglot.entities.PersonB1M


    private void onassertBi1MAssociation(PersistenceDelegator delegator)
    {
        KunderaQuery kunderaQuery;
        CoreQuery queryObj;
        PersonB1M personBi1M = new PersonB1M();
       
        personBi1M.setPersonId("personBi1M1");
        personBi1M.setPersonName("impetus-opensource");
       
        AddressB1M addressBi1M = new AddressB1M();
        addressBi1M.setAddressId("addrBi1M1");
        addressBi1M.setStreet("meri gali");
        Set<AddressB1M> addresses = new HashSet<AddressB1M>();
        addresses.add(addressBi1M);
//        personBi1M.setAddresses(addresses);
       
        AddressB1M addressBi1M_copy = new AddressB1M();
        addressBi1M_copy.setAddressId("addrBi1M2");
        addressBi1M_copy.setStreet("meri gali");
        addresses.add(addressBi1M_copy);
        personBi1M.setAddresses(addresses);

        em.persist(personBi1M);
       
        em.clear();
       
View Full Code Here


        Set<AddressB1M> addressess = new HashSet<AddressB1M>();
        addressess.add(address1);
        addressess.add(address2);

        PersonB1M p1 = new PersonB1M();
        p1.setPersonName("vivek");
        p1.setPersonId("1");
        p1.setAddresses(addressess);

        em.persist(p1);

        PersistenceDelegator delegator = CoreTestUtilities.getDelegator(em);

        Map<String, Object> relationMap = null;

        EntityMetadata metadata = KunderaMetadataManager.getEntityMetadata(
                ((EntityManagerFactoryImpl) emf).getKunderaMetadataInstance(), PersonB1M.class);

        CoreTestEntityReader reader = new CoreTestEntityReader(kunderaMetadata);

        p1.setAddresses(null);

        reader.recursivelyFindEntities(p1, relationMap, metadata, delegator, false);

        Assert.assertNotNull(p1.getAddresses());

        Assert.assertTrue(ProxyHelper.isKunderaProxyCollection(p1.getAddresses()));
        // Assert.assertEquals(p1,
        // p1.getAddresses().iterator().next().getPerson());
        // Assert.assertEquals(p1,
        // p1.getAddresses().iterator().next().getPerson());

        p1.setAddresses(null);

        reader.recursivelyFindEntities(p1, relationMap, metadata, delegator, true);

        Assert.assertNotNull(p1.getAddresses());

        Assert.assertFalse(ProxyHelper.isKunderaProxyCollection(p1.getAddresses()));

        // Assert.assertEquals(p1,
        // p1.getAddresses().iterator().next().getPerson());
        // Assert.assertEquals(p1,
        // p1.getAddresses().iterator().next().getPerson());
View Full Code Here

    }

    @Override
    protected void insert()
    {
        PersonB1M personnel = new PersonB1M();
        personnel.setPersonId("bionetomany_1");
        personnel.setPersonName("Amresh");

        Set<AddressB1M> addresses = new HashSet<AddressB1M>();
        AddressB1M address1 = new AddressB1M();
        address1.setAddressId("bionetomany_a");
        address1.setStreet("AAAAAAAAAAAAA");

        AddressB1M address2 = new AddressB1M();
        address2.setAddressId("bionetomany_b");
        address2.setStreet("BBBBBBBBBBB");

        addresses.add(address1);
        addresses.add(address2);
        personnel.setAddresses(addresses);
        dao.insert(personnel);
     }
View Full Code Here

    @Override
    protected void find()
    {
        // Find Person
        PersonB1M p = (PersonB1M) dao.findPerson(PersonB1M.class, "bionetomany_1");
        assertPerson(p);

    }
View Full Code Here

    }

    @Override
    protected void findPersonByIdColumn()
    {
        PersonB1M p = (PersonB1M) dao.findPersonByIdColumn(PersonB1M.class, "bionetomany_1");
        assertPerson(p);
    }
View Full Code Here

    {
        List<PersonB1M> persons = dao.findPersonByName(PersonB1M.class, "Amresh");
        Assert.assertNotNull(persons);
        Assert.assertFalse(persons.isEmpty());
        Assert.assertTrue(persons.size() == 1);
        PersonB1M person = persons.get(0);
        assertPerson(person);
    }
View Full Code Here

    @Override
    protected void update()
    {
        // Find Person
        PersonB1M p = (PersonB1M) dao.findPerson(PersonB1M.class, "bionetomany_1");
        assertPerson(p);

        p.setPersonName("Saurabh");
        for (AddressB1M address : p.getAddresses())
        {
            address.setStreet("Brand New Street");
        }
        dao.merge(p);
        PersonB1M pAfterMerge = (PersonB1M) dao.findPerson(PersonB1M.class, "bionetomany_1");

        assertPersonAfterUpdate(pAfterMerge);
    }
View Full Code Here

    @Override
    protected void remove()
    {
        // Find Person
        PersonB1M p = (PersonB1M) dao.findPerson(PersonB1M.class, "bionetomany_1");
        assertPersonAfterUpdate(p);

        dao.remove("bionetomany_1", PersonB1M.class);
        PersonB1M pAfterRemoval = (PersonB1M) dao.findPerson(PersonB1M.class, "bionetomany_1");
        Assert.assertNull(pAfterRemoval);
    }
View Full Code Here

        Assert.assertEquals(2, adds.size());

        for (AddressB1M address : adds)
        {
            Assert.assertNotNull(address);
            PersonB1M person = address.getPerson();
            /*Assert.assertNotNull(person);
            Assert.assertEquals(p.getPersonId(), person.getPersonId());
            Assert.assertEquals(p.getPersonName(), person.getPersonName());
            Assert.assertNotNull(person.getAddresses());
            Assert.assertFalse(person.getAddresses().isEmpty());
View Full Code Here

        for (AddressB1M address : adds)
        {
            Assert.assertNotNull(address);
            Assert.assertEquals("Brand New Street", address.getStreet());
            PersonB1M person = address.getPerson();
            /*Assert.assertNotNull(person);
            Assert.assertEquals(p.getPersonId(), person.getPersonId());
            Assert.assertEquals(p.getPersonName(), person.getPersonName());
            Assert.assertNotNull(person.getAddresses());
            Assert.assertFalse(person.getAddresses().isEmpty());
View Full Code Here

TOP

Related Classes of com.impetus.kundera.polyglot.entities.PersonB1M

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.