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

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


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

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

        // Insert min value of byte
        StudentBytePrimitive studentMin = new StudentBytePrimitive();
        studentMin.setAge((Short) getMinValue(short.class));
        studentMin.setId((Byte) getMinValue(byte.class));
        studentMin.setName((String) getMinValue(String.class));
        em.persist(studentMin);

        // Insert random value of byte
        StudentBytePrimitive student = new StudentBytePrimitive();
        student.setAge((Short) getRandomValue(short.class));
        student.setId((Byte) getRandomValue(byte.class));
        student.setName((String) getRandomValue(String.class));
        em.persist(student);
        em.close();
    }
View Full Code Here


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

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

        if (!useSameEm)
        {
            em.close();
            em = emf.createEntityManager();
        }
        StudentBytePrimitive studentMin = em.find(StudentBytePrimitive.class, getMinValue(byte.class));
        Assert.assertNotNull(studentMin);
        Assert.assertEquals(getMinValue(short.class), studentMin.getAge());
        Assert.assertEquals(getMinValue(String.class), studentMin.getName());

        if (!useSameEm)
        {
            em.close();
            em = emf.createEntityManager();
        }
        StudentBytePrimitive student = em.find(StudentBytePrimitive.class, getRandomValue(byte.class));
        Assert.assertNotNull(student);
        Assert.assertEquals(getRandomValue(short.class), student.getAge());
        Assert.assertEquals(getRandomValue(String.class), student.getName());
        em.close();
    }
View Full Code Here

    }

    public void testMerge(boolean useSameEm)
    {
        EntityManager em = emf.createEntityManager();
        StudentBytePrimitive student = em.find(StudentBytePrimitive.class, getMaxValue(byte.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();
        }
        StudentBytePrimitive newStudent = em.find(StudentBytePrimitive.class, getMaxValue(byte.class));
        Assert.assertNotNull(newStudent);
        Assert.assertEquals(getMaxValue(short.class), newStudent.getAge());
        Assert.assertEquals("Kuldeep", newStudent.getName());
    }
View Full Code Here

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

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

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

        if (!useSameEm)
        {
            em.close();
            em = emf.createEntityManager();
        }
        StudentBytePrimitive newStudent = em.find(StudentBytePrimitive.class, getRandomValue(byte.class));
        Assert.assertNotNull(newStudent);
        Assert.assertEquals(getRandomValue(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 byte
        StudentBytePrimitive studentMax = new StudentBytePrimitive();
        studentMax.setAge((Short) getMaxValue(short.class));
        studentMax.setId((Byte) getMaxValue(byte.class));
        studentMax.setName((String) getMaxValue(String.class));
        em.persist(studentMax);

        // Insert min value of byte
        StudentBytePrimitive studentMin = new StudentBytePrimitive();
        studentMin.setAge((Short) getMinValue(short.class));
        studentMin.setId((Byte) getMinValue(byte.class));
        studentMin.setName((String) getMinValue(String.class));
        em.persist(studentMin);

        // Insert random value of byte
        StudentBytePrimitive student = new StudentBytePrimitive();
        student.setAge((Short) getRandomValue(short.class));
        student.setId((Byte) getRandomValue(byte.class));
        student.setName((String) getRandomValue(String.class));
        em.persist(student);
        em.close();
    }
View Full Code Here

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

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

        if (!useSameEm)
        {
            em.close();
            em = emf.createEntityManager();
        }
        StudentBytePrimitive studentMin = em.find(StudentBytePrimitive.class, getMinValue(byte.class));
        Assert.assertNotNull(studentMin);
        Assert.assertEquals(getMinValue(short.class), studentMin.getAge());
        Assert.assertEquals(getMinValue(String.class), studentMin.getName());

        if (!useSameEm)
        {
            em.close();
            em = emf.createEntityManager();
        }
        StudentBytePrimitive student = em.find(StudentBytePrimitive.class, getRandomValue(byte.class));
        Assert.assertNotNull(student);
        Assert.assertEquals(getRandomValue(short.class), student.getAge());
        Assert.assertEquals(getRandomValue(String.class), student.getName());
        em.close();
    }
View Full Code Here

    }

    public void testMerge(boolean useSameEm)
    {
        EntityManager em = emf.createEntityManager();
        StudentBytePrimitive student = em.find(StudentBytePrimitive.class, getMaxValue(byte.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();
        }
        StudentBytePrimitive newStudent = em.find(StudentBytePrimitive.class, getMaxValue(byte.class));
        Assert.assertNotNull(newStudent);
        Assert.assertEquals(getMaxValue(short.class), newStudent.getAge());
        Assert.assertEquals("Kuldeep", newStudent.getName());
    }
View Full Code Here

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

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

TOP

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

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.