Package com.impetus.client.crud.datatypes.entities

Examples of com.impetus.client.crud.datatypes.entities.StudentMongoCalendar


    public void testDelete(boolean useSameEm)
    {
        EntityManager em = emf.createEntityManager();

        // Insert max value of Calendar
        StudentMongoCalendar studentMax = new StudentMongoCalendar();
        studentMax.setAge((Short) getMaxValue(short.class));
        studentMax.setId(((Calendar) getMaxValue(Calendar.class)));
        studentMax.setName((String) getMaxValue(String.class));
        em.persist(studentMax);

        em.close();

        em = emf.createEntityManager();

        studentMax = em.find(StudentMongoCalendar.class, getMaxValue(Calendar.class));
        Assert.assertNotNull(studentMax);
        Assert.assertEquals(getMaxValue(short.class), studentMax.getAge());
        Assert.assertEquals(getMaxValue(String.class), studentMax.getName());
        em.remove(studentMax);
        if (!useSameEm)
        {
            em.close();
            em = emf.createEntityManager();
View Full Code Here


        if (!useSameEm)
        {
            em.close();
            em = emf.createEntityManager();
        }
        StudentMongoCalendar newStudent = em.find(StudentMongoCalendar.class, getRandomValue(Calendar.class));
        Assert.assertNull(newStudent);
        em.close();
    }
View Full Code Here

        if (!useSameEm)
        {
            em.close();
            em = emf.createEntityManager();
        }
        StudentMongoCalendar newStudent = em.find(StudentMongoCalendar.class, getRandomValue(Calendar.class));
        Assert.assertNotNull(newStudent);
        Assert.assertEquals(getMaxValue(short.class), newStudent.getAge());
        Assert.assertEquals("Vivek", newStudent.getName());
        em.close();
    }
View Full Code Here

    public void testPersist(boolean useSameEm)
    {
        EntityManager em = emf.createEntityManager();

        // Insert max value of Calendar
        StudentMongoCalendar studentMax = new StudentMongoCalendar();
        studentMax.setAge((Short) getMaxValue(short.class));
        studentMax.setId(((Calendar) getMaxValue(Calendar.class)));
        studentMax.setName((String) getMaxValue(String.class));
        em.persist(studentMax);

        em.close();
    }
View Full Code Here

    public void testFindById(boolean useSameEm)
    {
        EntityManager em = emf.createEntityManager();

        StudentMongoCalendar studentMax = em.find(StudentMongoCalendar.class, getMaxValue(Calendar.class));
        Assert.assertNotNull(studentMax);
        Assert.assertEquals(getMaxValue(short.class), studentMax.getAge());
        Assert.assertEquals(getMaxValue(String.class), studentMax.getName());

        em.close();
    }
View Full Code Here

    }

    public void testMerge(boolean useSameEm)
    {
        EntityManager em = emf.createEntityManager();
        StudentMongoCalendar student = em.find(StudentMongoCalendar.class, getMaxValue(Calendar.class));
        Assert.assertNotNull(student);
        Assert.assertEquals(getMaxValue(short.class), student.getAge());
        Assert.assertEquals(getMaxValue(String.class), student.getName());

        student.setName("Kuldeep");
        em.merge(student);
        if (!useSameEm)
        {
            em.close();
            em = emf.createEntityManager();
        }
        StudentMongoCalendar newStudent = em.find(StudentMongoCalendar.class, getMaxValue(Calendar.class));
        Assert.assertNotNull(newStudent);
        Assert.assertEquals(getMaxValue(short.class), newStudent.getAge());
        Assert.assertEquals("Kuldeep", newStudent.getName());
    }
View Full Code Here

TOP

Related Classes of com.impetus.client.crud.datatypes.entities.StudentMongoCalendar

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.