Examples of PersonnelDTO


Examples of com.impetus.kundera.entity.PersonnelDTO

        cacheProvider.init(cacheResource);

        cache = (Cache) cacheProvider.createCache("Kundera");
        ems = new EntityManagerSession(cache);

        person1 = new PersonnelDTO("1", "Amresh", "Singh");
        person2 = new PersonnelDTO("2", "Vivek", "Mishra");
    }
View Full Code Here

Examples of com.impetus.kundera.entity.PersonnelDTO

        assertEquals(1, ems.getL2Cache().size());
        ems.store(person2.getPersonId(), person2);
        assertEquals(2, ems.getL2Cache().size());

        // Lookup object from session
        PersonnelDTO p1 = ems.lookup(PersonnelDTO.class, person1.getPersonId());
        assertNotNull(p1);
        assertEquals(person1.getPersonId(), p1.getPersonId());
        assertEquals(person1.getFirstName(), p1.getFirstName());
        assertEquals(person1.getLastName(), p1.getLastName());

        // Remove object from session
        ems.remove(PersonnelDTO.class, person1.getPersonId());
        assertNotNull(ems);
        assertEquals(1, ems.getL2Cache().size());
View Full Code Here

Examples of com.impetus.kundera.entity.PersonnelDTO

    {
        super.setUp();

        cacheProvider = new EhCacheProvider();

        person1 = new PersonnelDTO("1", "Amresh", "Singh");
        person2 = new PersonnelDTO("2", "Vivek", "Mishra");

    }
View Full Code Here

Examples of com.impetus.kundera.entity.PersonnelDTO

        assertEquals(2, ehCache.size());

        // Lookup objects from cache
        Object o = ehCache.get(person1.getClass() + "_" + person1.getPersonId());
        assertEquals(PersonnelDTO.class, o.getClass());
        PersonnelDTO p1 = (PersonnelDTO) o;
        assertNotNull(p1);
        assertEquals("1", p1.getPersonId());
        assertEquals("Amresh", p1.getFirstName());
        assertEquals("Singh", p1.getLastName());

        // Remove object from cache
        ehCache.evict(PersonnelDTO.class, PersonnelDTO.class + "_" + person1.getPersonId());
        assertEquals(1, ehCache.size());
View Full Code Here

Examples of com.impetus.kundera.entity.PersonnelDTO

    @Test
    public void testWithPDInstance() throws NoSuchMethodException, Throwable
    {
        PersistenceDelegator delegator = CoreTestUtilities.getDelegator(em);
        PersonnelDTO dto = new PersonnelDTO("1", "vivek", "mishra");
        em.persist(dto);
        LazyInitializerFactory factory = kunderaMetadata.getCoreMetadata().getLazyInitializerFactory();
        KunderaProxy proxy = factory.getProxy("personnel#1", PersonnelDTO.class, null, null, "1", delegator);
        LazyInitializer li = proxy.getKunderaLazyInitializer();
        ((CglibLazyInitializer)li).setPersistenceDelegator(delegator);
View Full Code Here

Examples of com.impetus.kundera.entity.PersonnelDTO

   
    @Test
    public void testWithClosedPDInstance() throws NoSuchFieldException, SecurityException, IllegalArgumentException, IllegalAccessException
    {
        PersistenceDelegator delegator = CoreTestUtilities.getDelegator(em);
        PersonnelDTO dto = new PersonnelDTO("1", "vivek", "mishra");
        em.persist(dto);
        em.close();

        LazyInitializerFactory factory = kunderaMetadata.getCoreMetadata().getLazyInitializerFactory();
        KunderaProxy proxy = factory.getProxy("personnel", PersonnelDTO.class, null, null, "1", delegator);
View Full Code Here

Examples of com.impetus.kundera.entity.PersonnelDTO

        catch (Exception e1)
        {
            Assert.assertTrue(e1.getCause().getClass().equals(IllegalArgumentException.class));
        }

        PersonnelDTO dto = new PersonnelDTO();
        try
        {
            em.persist(dto);
        }
        catch (KunderaException e)
        {
            Assert.assertEquals(
                    "java.lang.IllegalArgumentException: Entity to be persisted can't have Primary key set to null.",
                    e.getMessage());
        }
        try
        {
            CoreEntityAddressUni1To1 Oneto1 = new CoreEntityAddressUni1To1();
            em.persist(Oneto1);
        }
        catch (KunderaException e)
        {
            Assert.assertNotNull(e.getMessage());
        }

        em.clear();

        dto = new PersonnelDTO();
        dto.setPersonId("123");
        em.persist(dto);
        dto = em.find(PersonnelDTO.class, "123");
        Assert.assertNotNull(dto);
        Assert.assertEquals("123", dto.getPersonId());
    }
View Full Code Here

Examples of com.impetus.kundera.entity.PersonnelDTO

    }

    @Test
    public void testFindById()
    {
        PersonnelDTO dto = new PersonnelDTO();
        dto.setPersonId("123");
        em.persist(dto);
        try
        {
            em.find(null, null);
        }
View Full Code Here

Examples of com.impetus.kundera.entity.PersonnelDTO

    }

    @Test
    public void testFindForObjectArray()
    {
        PersonnelDTO dto = new PersonnelDTO();
        dto.setPersonId("111");
        em.persist(dto);

        dto = new PersonnelDTO();
        dto.setPersonId("222");
        em.persist(dto);

        dto = new PersonnelDTO();
        dto.setPersonId("333");
        em.persist(dto);

        PersistenceDelegator pd = ((EntityManagerImpl) em).getPersistenceDelegator();

        List<PersonnelDTO> persons = pd.find(PersonnelDTO.class, new String[] { "111", "222", "333" });
View Full Code Here

Examples of com.impetus.kundera.entity.PersonnelDTO

    }

    @Test
    public void testRemove()
    {
        PersonnelDTO paramObject = new PersonnelDTO();
        PersonnelDTO dto = new PersonnelDTO();
        dto.setPersonId("123");
        em.persist(dto);
        dto = em.find(PersonnelDTO.class, 123);
        try
        {
            em.remove(null);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.