Package com.impetus.kundera.entity

Examples of com.impetus.kundera.entity.PersonnelDTO


    }

    @Test
    public void testMerge()
    {
        PersonnelDTO dto = new PersonnelDTO();
        dto.setPersonId("123");
        em.persist(dto);
        dto = em.find(PersonnelDTO.class, 123);
        Assert.assertNotNull(dto);

        dto.setFirstName("kuldeep");
        em.merge(dto);
        dto = em.find(PersonnelDTO.class, 123);
        Assert.assertNotNull(dto);
        Assert.assertEquals("kuldeep", dto.getFirstName());
        try
        {
            em.merge(null);
        }
        catch (KunderaException e)
        {
            Assert.assertEquals("java.lang.IllegalArgumentException: Entity to be merged must not be null.",
                    e.getMessage());
        }

        try
        {
            em.merge(new PersonnelDTO());
        }
        catch (KunderaException e)
        {
            Assert.assertEquals("java.lang.IllegalArgumentException: Entity to be persisted can't have Primary key set to null.",
                    e.getMessage());
View Full Code Here


    }

    @Test
    public void testDetach()
    {
        PersonnelDTO dto = new PersonnelDTO();
        PersistenceDelegator pd = ((EntityManagerImpl) em).getPersistenceDelegator();
        try
        {
            pd.detach(dto);
        }
        catch (IllegalArgumentException e)
        {
            Assert.assertEquals("Primary key not set into entity", e.getMessage());
        }

        dto.setPersonId("123");
        try
        {
            pd.detach(dto);
        }
        catch (IllegalArgumentException e)
View Full Code Here

    }

    @Test
    public void testGetClient()
    {
        PersonnelDTO dto = new PersonnelDTO();
        EntityMetadata entityMetadata = KunderaMetadataManager.getEntityMetadata(((EntityManagerFactoryImpl)emf).getKunderaMetadataInstance(), dto.getClass());
        PersistenceDelegator pd = ((EntityManagerImpl) em).getPersistenceDelegator();
        Client c = pd.getClient(entityMetadata);
        Assert.assertNotNull(c);
        Assert.assertTrue(c instanceof CoreTestClient);
View Full Code Here

    }

    @Test
    public void testContains()
    {
        PersonnelDTO dto = new PersonnelDTO();
        dto.setPersonId("123");
        PersistenceDelegator pd = ((EntityManagerImpl) em).getPersistenceDelegator();

        Assert.assertFalse(pd.contains(dto));

        em.persist(dto);
View Full Code Here

    }

    @Test
    public void testRefresh()
    {
        PersonnelDTO dto = new PersonnelDTO();
        dto.setPersonId("123");
        PersistenceDelegator pd = ((EntityManagerImpl) em).getPersistenceDelegator();

        try
        {
            pd.refresh(dto);
View Full Code Here

TOP

Related Classes of com.impetus.kundera.entity.PersonnelDTO

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.