1 29 30 package com.caucho.amber.manager; 31 32 import javax.persistence.EntityManager; 33 import javax.persistence.EntityManagerFactory; 34 import java.util.Map ; 35 import java.util.logging.Logger ; 36 37 40 public class AmberEntityManagerFactory implements EntityManagerFactory { 41 private static final Logger log 42 = Logger.getLogger(AmberEntityManagerFactory.class.getName()); 43 44 private AmberPersistenceUnit _unit; 45 private boolean _isOpen = true; 46 47 AmberEntityManagerFactory(AmberPersistenceUnit unit) 48 { 49 _unit = unit; 50 } 51 52 55 public EntityManager createEntityManager() 56 { 57 return createEntityManager(null); 58 } 59 60 63 public EntityManager createEntityManager(Map map) 64 { 65 return new AmberEntityManager(_unit); 66 } 67 68 71 public void close() 72 { 73 _isOpen = false; 74 } 75 76 79 public boolean isOpen() 80 { 81 return _isOpen; 82 } 83 84 public String toString() 85 { 86 return "AmberEntityManagerFactory[" + _unit.getName() + "]"; 87 } 88 } 89 90 91 | Popular Tags |