Details | Last modification | View Log | RSS feed
| Rev | Author | Line No. | Line |
|---|---|---|---|
| 33 | PointedEar | 1 | //$Id: EntityManagerFactory.java 11282 2007-03-14 22:05:59Z epbernard $ |
| 2 | package javax.persistence; |
||
| 3 | |||
| 4 | import java.util.Map; |
||
| 5 | |||
| 6 | /** |
||
| 7 | * The EntityManagerFactory interface is used by the application to obtain an |
||
| 8 | * application-managed entity manager. When the application has finished using |
||
| 9 | * the entity manager factory, and/or at application shutdown, the application |
||
| 10 | * should close the entity manager factory. Once an EntityManagerFactory has been |
||
| 11 | * closed, all its entity managers are considered to be in the closed state. |
||
| 12 | * |
||
| 13 | * @author Emmanuel Bernard |
||
| 14 | */ |
||
| 15 | public interface EntityManagerFactory { |
||
| 16 | |||
| 17 | /** |
||
| 18 | * Create a new EntityManager. |
||
| 19 | * This method returns a new EntityManager instance each time |
||
| 20 | * it is invoked. |
||
| 21 | * The isOpen method will return true on the returned instance. |
||
| 22 | */ |
||
| 23 | EntityManager createEntityManager(); |
||
| 24 | |||
| 25 | /** |
||
| 26 | * Create a new EntityManager with the specified Map of |
||
| 27 | * properties. |
||
| 28 | * This method returns a new EntityManager instance each time |
||
| 29 | * it is invoked. |
||
| 30 | * The isOpen method will return true on the returned instance. |
||
| 31 | */ |
||
| 32 | EntityManager createEntityManager(Map map); |
||
| 33 | |||
| 34 | /** |
||
| 35 | * Close the factory, releasing any resources that it holds. |
||
| 36 | * After a factory instance is closed, all methods invoked on |
||
| 37 | * it will throw an IllegalStateException, except for isOpen, |
||
| 38 | * which will return false. Once an EntityManagerFactory has |
||
| 39 | * been closed, all its entity managers are considered to be |
||
| 40 | * in the closed state. |
||
| 41 | */ |
||
| 42 | void close(); |
||
| 43 | |||
| 44 | /** |
||
| 45 | * Indicates whether or not this factory is open. Returns |
||
| 46 | * true until a call to close has been made. |
||
| 47 | */ |
||
| 48 | public boolean isOpen(); |
||
| 49 | } |