List of usage examples for javax.persistence EntityManagerFactory getCache
public Cache getCache();
From source file:com.impetus.kundera.persistence.EntityManagerImpl.java
/** * Instantiates a new entity manager impl. * /*from w w w .j a v a 2 s . co m*/ * @param factory * the factory */ EntityManagerImpl(final EntityManagerFactory factory, final PersistenceUnitTransactionType transactionType, final PersistenceContextType persistenceContextType) { this.factory = factory; if (logger.isDebugEnabled()) { logger.debug("Creating EntityManager for persistence unit : " + getPersistenceUnit()); } this.persistenceContextType = persistenceContextType; this.persistenceCache = new PersistenceCache((Cache) factory.getCache()); this.persistenceCache.setPersistenceContextType(this.persistenceContextType); this.transactionType = transactionType; this.persistenceDelegator = new PersistenceDelegator( ((EntityManagerFactoryImpl) this.factory).getKunderaMetadataInstance(), this.persistenceCache); for (String pu : ((EntityManagerFactoryImpl) this.factory).getPersistenceUnits()) { this.persistenceDelegator.loadClient(pu, discoverClient(pu)); } if (logger.isDebugEnabled()) { logger.debug("Created EntityManager for persistence unit : " + getPersistenceUnit()); } }