Package javax.persistence

Examples of javax.persistence.EntityManager.clear()


        EntityManager em = emf.createEntityManager();
        em.getTransaction().begin();
        em.persist(entity);
        em.getTransaction().commit();
        em.clear();

        SQLBigDecimalIdEntity persistedEntity = em.find(SQLBigDecimalIdEntity.class, id);
        StateManagerImpl smi = ((StateManagerImpl) ((PersistenceCapable) persistedEntity).pcGetStateManager());
        Object oid = smi.getObjectId();
View Full Code Here


       
        em.getTransaction().begin();
        em.persist(d);
        em.getTransaction().commit();
       
        em.clear();
       
        d = findDepartment(em, d.getId());
        assertNoneSQLAnyOrder("SELECT .* DC_DEP_LOC .*");
        // verify that the collection is not delay loaded and does not trigger a load
        resetSQL();
View Full Code Here

        EntityManager em = emf.createEntityManager();
        em.getTransaction().begin();
        em.persist(entity);
        em.getTransaction().commit();
        em.clear();

        SQLDateIdEntity persistedEntity = em.find(SQLDateIdEntity.class, id);
        StateManagerImpl smi = ((StateManagerImpl) ((PersistenceCapable) persistedEntity).pcGetStateManager());
        Object oid = smi.getObjectId();
View Full Code Here

        d.setEmployees(emps);
       
        em.getTransaction().begin();
        em.persist(d);
        em.getTransaction().commit();
        em.clear();
       
        resetSQL();
        d = findDepartment(em, d.getId());
        // assert the select did not contain the employee table
        assertNoneSQLAnyOrder("SELECT .* DC_EMPLOYEE .*");
 
View Full Code Here

        EntityManager em = emf.createEntityManager();
        em.getTransaction().begin();
        em.persist(id);
        em.persist(entity);
        em.getTransaction().commit();
        em.clear();

        EDSQLDateID persistedEntity = em.find(EDSQLDateID.class, d);
        StateManagerImpl smi = ((StateManagerImpl) ((PersistenceCapable) persistedEntity).pcGetStateManager());
        Object oid = smi.getObjectId();
View Full Code Here

        EntityManager em = emf.createEntityManager();
        em.getTransaction().begin();
        em.persist(entity);
        em.getTransaction().commit();
        em.clear();

        BookId id = new BookId();
        id.setName(bookName);
        id.setLibrary(libName);
View Full Code Here

        em.persist(d);
        em.getTransaction().commit();
       
        resetSQL();

        em.clear();
       
        d = findDepartment(em, d.getId());
        assertNoneSQLAnyOrder("SELECT .* DC_DEP_CERT .*");
        resetSQL();
        certs = d.getCertifications();
View Full Code Here

        em.persist(d);
        em.getTransaction().commit();
       
        resetSQL();

        em.clear();
       
        d = findDepartment(em, d.getId());
        assertAnySQLAnyOrder("SELECT .* DC_DEP_AWD .*");
        resetSQL();
        awards = d.getAwards();
View Full Code Here

        EntityManager em = emf.createEntityManager();
        em.getTransaction().begin();
        em.persist(person);
        em.persist(entity);
        em.getTransaction().commit();
        em.clear();

        MedicalHistory4 persistedEntity = em.find(MedicalHistory4.class, id);
        StateManagerImpl smi = ((StateManagerImpl) ((PersistenceCapable) persistedEntity).pcGetStateManager());
        Object oid = smi.getObjectId();
View Full Code Here

       
        em.getTransaction().begin();
        em.persist(d);
        em.getTransaction().commit();
        resetSQL();
        em.clear();
       
        d = findDepartment(em, d.getId());
        emps = d.getEmployees();
        em.close();
       
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.