Examples of XMLExceptionEntity


Examples of org.apache.openjpa.persistence.arrays.model.XMLExceptionEntity

   
    public void testExceptionArrayAsLob() {
        EntityManager em = emf.createEntityManager();
        em.getTransaction().begin();
       
        XMLExceptionEntity e = new XMLExceptionEntity();
        e.setId(1);
        em.persist(e);
        e.setExceptions(new ArrayList<Exception>());
        e.getExceptions().add(new Exception("Exception 1"));
        e.getExceptions().add(new Exception("Exception 2"));
        em.getTransaction().commit();
       
        em.clear();
        e = em.find(XMLExceptionEntity.class, 1);
       
        assertNotNull(e);
        assertNotNull(e.getExceptions());
        assertEquals(2, e.getExceptions().size());
        // we don't really care about ordering for this example.
       
        em.getTransaction().begin();
        em.remove(e);
        em.getTransaction().commit();
View Full Code Here

Examples of org.apache.openjpa.persistence.arrays.model.XMLExceptionEntity

   
    public void testExceptionPersistentCollection() {
        EntityManager em = emf.createEntityManager();
        em.getTransaction().begin();
       
        XMLExceptionEntity e = new XMLExceptionEntity();
        e.setId(1);
        em.persist(e);
        e.setPersCollExceptions(new ArrayList<Exception>());
        e.getPersCollExceptions().add(new Exception("Exception 1"));
        e.getPersCollExceptions().add(new Exception("Exception 2"));
        em.getTransaction().commit();
       
        em.clear();
        e = em.find(XMLExceptionEntity.class, 1);
       
        assertNotNull(e);
        assertNotNull(e.getPersCollExceptions());
        assertEquals(2, e.getPersCollExceptions().size());
        // we don't really care about ordering for this example.
       
        em.getTransaction().begin();
        em.remove(e);
        em.getTransaction().commit();
View Full Code Here

Examples of org.apache.openjpa.persistence.arrays.model.XMLExceptionEntity

   
    public void testExceptionElementCollection() {
        EntityManager em = emf.createEntityManager();
        em.getTransaction().begin();
       
        XMLExceptionEntity e = new XMLExceptionEntity();
        e.setId(1);
        em.persist(e);
        e.setElemCollExceptions(new ArrayList<String>());
        e.getElemCollExceptions().add(new Exception("Exception 1").toString());
        e.getElemCollExceptions().add(new Exception("Exception 2").toString());
        em.getTransaction().commit();
       
        em.clear();
        e = em.find(XMLExceptionEntity.class, 1);
       
        assertNotNull(e);
        assertNotNull(e.getElemCollExceptions());
        assertEquals(2, e.getElemCollExceptions().size());
        // we don't really care about ordering for this example.
       
        em.getTransaction().begin();
        em.remove(e);
        em.getTransaction().commit();
View Full Code Here

Examples of org.apache.openjpa.persistence.arrays.model.XMLExceptionEntity

   
    public void testExceptionArrayAsLob() {
        EntityManager em = emf.createEntityManager();
        em.getTransaction().begin();
       
        XMLExceptionEntity e = new XMLExceptionEntity();
        e.setId(1);
        em.persist(e);
        e.setExceptions(new ArrayList<Exception>());
        e.getExceptions().add(new Exception("Exception 1"));
        e.getExceptions().add(new Exception("Exception 2"));
        em.getTransaction().commit();
       
        em.clear();
        e = em.find(XMLExceptionEntity.class, 1);
       
        assertNotNull(e);
        assertNotNull(e.getExceptions());
        assertEquals(2, e.getExceptions().size());
        // we don't really care about ordering for this example.
       
        em.getTransaction().begin();
        em.remove(e);
        em.getTransaction().commit();
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.