Package javax.persistence

Examples of javax.persistence.EntityManager.clear()


        EntityManager em = emf.createEntityManager();
        em.getTransaction().begin();
        CascadePersistEntity cpe1 = new CascadePersistEntity(startId);
        em.persist(cpe1);
        em.getTransaction().commit();
        em.clear();

        em.getTransaction().begin();
        CascadePersistEntity cpe2 = new CascadePersistEntity(startId + 1);
        CascadePersistEntity cpe3 = new CascadePersistEntity(startId);
View Full Code Here


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

        FloatIdEntity persistedEntity = em.find(FloatIdEntity.class, id);
        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();

        BooleanIdEntity persistedEntity = em.find(BooleanIdEntity.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

        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(entity);
        em.getTransaction().commit();
        em.clear();

        StringIdEntity persistedEntity = em.find(StringIdEntity.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(entity);
        em.getTransaction().commit();
        em.clear();

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

        em.persist(aCase);
        em.getTransaction ().commit ();

        verify(aCase, aText, aEvident);

        em.clear();

        ACase fACase = em.find(ACase.class, aCase.getId());
        AText fAText = fACase.getAText();
        AEvident fAEvident = fAText.getAEvidents().iterator().next();
        verify(fACase, fAText, fAEvident);
View Full Code Here

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

        em.clear();
       
        d = findDepartment(em, d.getId());
        assertAnySQLAnyOrder("SELECT .* DC_DEP_PRD .*");
        resetSQL();
        products = d.getProducts();
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.