Examples of PersistenceUnitUtil


Examples of javax.persistence.PersistenceUnitUtil

    }

    @Test
    public void testGetIdentifier()
    {
        PersistenceUnitUtil utils = emf.getPersistenceUnitUtil();
       
        Person p = new Person();
        p.setAge(32);
        p.setPersonId("1");
       
        Assert.assertNotNull(utils.getIdentifier(p));
        Assert.assertEquals("1",utils.getIdentifier(p));
    }
View Full Code Here

Examples of javax.persistence.PersistenceUnitUtil

    }

    @Test
    public void testInvalidEntity()
    {
        PersistenceUnitUtil utils = emf.getPersistenceUnitUtil();
       
        Person p = new Person();
        p.setAge(32);
        p.setPersonId("1");
       
        try
        {
            utils.getIdentifier(new String("test"));
            Assert.fail("Should have gone to catch block!");
        } catch(IllegalArgumentException iaex)
        {
            Assert.assertEquals(String.class + " is not an entity", iaex.getMessage());
        }
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.