javax.persistence
Class Persistence

java.lang.Object
  extended by javax.persistence.Persistence

public class Persistence
extends Object

Bootstrap class that provides access to an EntityManagerFactory. Warning: this class is from the EJB 3.0 Persistence API Early Draft 2 published on February 7, 2005, and as such is likely to change signifcantly in the future as the specification nears finalization.

See Also:
http://java.sun.com/products/ejb/docs.html

Field Summary
static String PROVIDER_NAME
          Symbolic constant used by calls to createEntityManagerFactory methods to look up the implementation to load.
 
Constructor Summary
Persistence()
           
 
Method Summary
static EntityManagerFactory createEntityManagerFactory()
          Create an EntityManagerFactory.
static EntityManagerFactory createEntityManagerFactory(Map m)
          Create an EntityManagerFactory.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PROVIDER_NAME

public static final String PROVIDER_NAME
Symbolic constant used by calls to createEntityManagerFactory methods to look up the implementation to load.

See Also:
Constant Field Values
Constructor Detail

Persistence

public Persistence()
Method Detail

createEntityManagerFactory

public static EntityManagerFactory createEntityManagerFactory(Map m)
Create an EntityManagerFactory. This looks through the following locations for a key called "javax.persistence.provider" that identifies which implementation should be created: 1. contents of the Map parameter to this method call 2. applet environment 3. system environment 4. the contents of persistence.properties, as loaded by a call to ClassLoader.getResourceAsStream, using the loader returned by Thread.getContextClassLoader. This search path is only used for looking up the setting of javax.persistence.provider; any vendor-defined settings will be looked up via means defined by the vendor.


createEntityManagerFactory

public static EntityManagerFactory createEntityManagerFactory()
Create an EntityManagerFactory. This uses the same means as createEntityManagerFactory(java.util.Map), except that no Map parameter is provided.


This documentation is for an early draft of the EJB 3.0 specification. For the most up to date version, see the official EJB specification at http://java.sun.com/products/ejb/.