|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectjavax.persistence.Persistence
public class Persistence
Bootstrap class that is used to obtain an EntityManagerFactory.
Field Summary | |
---|---|
private static boolean |
initialized
Persistence providers have been initialized ? |
static java.lang.String |
PERSISTENCE_PROVIDER
Persistence Provider property. |
private static java.lang.String |
PERSISTENCE_PROVIDER_JAR_PROPERTY
The provider supplies the provider configuration file by creating a text file named javax.persistence.spi.PersistenceProvider and placing it in the META-INF/services directory of one of its JAR files. |
private static java.lang.String |
PERSISTENCE_PROVIDER_MAP_PROPERTY
Property present in the map ? The javax.persistence.provider property was included in the Map passed to createEntityManagerFactory and the value of the property is the provider's implementation class. |
protected static java.util.Set<PersistenceProvider> |
providers
Set of persistence providers. |
Constructor Summary | |
---|---|
Persistence()
|
Method Summary | |
---|---|
private static void |
addPersistenceProvider(java.lang.String persistenceProviderName)
Add to the set of persistence provider the given persistence provider (by using its name). |
static EntityManagerFactory |
createEntityManagerFactory(java.lang.String persistenceUnitName)
Create and return an EntityManagerFactory for the named persistence unit. |
static EntityManagerFactory |
createEntityManagerFactory(java.lang.String persistenceUnitName,
java.util.Map properties)
Create and return an EntityManagerFactory for the named persistence unit using the given properties. |
private static PersistenceProvider |
getProviderForName(java.lang.String persistenceProviderName)
Gets a persistence provider for the given persistence provider name. |
private static void |
init()
Initialize the list of persistence providers. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static java.lang.String PERSISTENCE_PROVIDER
protected static final java.util.Set<PersistenceProvider> providers
private static final java.lang.String PERSISTENCE_PROVIDER_JAR_PROPERTY
private static final java.lang.String PERSISTENCE_PROVIDER_MAP_PROPERTY
private static boolean initialized
Constructor Detail |
---|
public Persistence()
Method Detail |
---|
public static EntityManagerFactory createEntityManagerFactory(java.lang.String persistenceUnitName)
persistenceUnitName
- The name of the persistence unit
public static EntityManagerFactory createEntityManagerFactory(java.lang.String persistenceUnitName, java.util.Map properties)
persistenceUnitName
- The name of the persistence unitproperties
- Additional properties to use when creating the factory.
The values of these properties override any values that may have
been configured elsewhere.
private static PersistenceProvider getProviderForName(java.lang.String persistenceProviderName)
persistenceProviderName
- the given persistence provider name.
private static void init()
private static void addPersistenceProvider(java.lang.String persistenceProviderName)
persistenceProviderName
- name of the persistence provider.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |