1 29 30 package com.caucho.amber.manager; 31 32 import com.caucho.util.L10N; 33 34 import javax.persistence.EntityManagerFactory; 35 import javax.persistence.spi.PersistenceProvider; 36 import javax.persistence.spi.PersistenceUnitInfo; 37 import java.util.Map ; 38 import java.util.logging.Logger ; 39 40 43 public class AmberPersistenceProvider implements PersistenceProvider { 44 private static final Logger log 45 = Logger.getLogger(AmberPersistenceProvider.class.getName()); 46 private static final L10N L 47 = new L10N(AmberPersistenceProvider.class); 48 49 52 public EntityManagerFactory createEntityManagerFactory(String name, 53 Map map) 54 { 55 AmberContainer container = AmberContainer.getLocalContainer(); 56 57 AmberPersistenceUnit pUnit = container.getPersistenceUnit(name); 58 59 if (pUnit != null) 60 return new AmberEntityManagerFactory(pUnit); 61 else 62 return null; 63 } 64 65 68 public EntityManagerFactory 69 createContainerEntityManagerFactory(PersistenceUnitInfo info, 70 Map map) 71 { 72 return null; 73 } 74 } 75 | Popular Tags |