Search in sources :

Example 1 with FlushModeType

use of javax.persistence.FlushModeType in project uPortal by Jasig.

the class JpaDateDimensionDao method getDateDimensionById.

@Override
public DateDimension getDateDimensionById(long key) {
    final EntityManager entityManager = this.getEntityManager();
    final FlushModeType flushMode = entityManager.getFlushMode();
    try {
        entityManager.setFlushMode(FlushModeType.COMMIT);
        return entityManager.find(DateDimensionImpl.class, key);
    } finally {
        entityManager.setFlushMode(flushMode);
    }
}
Also used : FlushModeType(javax.persistence.FlushModeType) EntityManager(javax.persistence.EntityManager) OpenEntityManager(org.apereo.portal.jpa.OpenEntityManager)

Aggregations

EntityManager (javax.persistence.EntityManager)1 FlushModeType (javax.persistence.FlushModeType)1 OpenEntityManager (org.apereo.portal.jpa.OpenEntityManager)1