EntityManagerFactory
in Java SE environments. It may also be used to cause schema
generation to occur.
The Persistence class is available in a Java EE
container environment as well; however, support for the Java SE
bootstrapping APIs is not required in container environments.
The Persistence class is used to obtain a PersistenceUtil instance in both
Java EE and Java SE environments.
| Modifier and Type | Class and Description |
|---|---|
| private static class | Persistence.PersistenceUtilImpl
Implementation of PersistenceUtil interface |
| Modifier and Type | Field and Description |
|---|---|
| public static final String | PERSISTENCE_PROVIDER
This final String is deprecated and should be removed and is only here for TCK backward compatibility |
| protected static final Set | providers
This instance variable is deprecated and should be removed and is only here for TCK backward compatibility |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public static EntityManagerFactory | Returns: the factory that creates EntityManagers configured according to the specified persistence unitthe name of the persistence unit persistenceUnitName)Create and return an EntityManagerFactory for the named persistence unit. |
| public static EntityManagerFactory | Returns: the factory that creates EntityManagers configured according to the specified persistence unit.the name of the persistence unit persistenceUnitName, Map<K, V> Additional properties to use when creating the factory.
These properties may include properties to control
schema generation. The values of these properties override
any values that may have been configured elsewhere. properties)Create and return an EntityManagerFactory for the named persistence unit using the given properties. |
| public static void | generateSchema(String
the name of the persistence unit persistenceUnitName, Map<K, V> properties for schema generation; these may
also contain provider-specific properties. The
value of these properties override any values that
may have been configured elsewhere.. map)Create database schemas and/or tables and/or create DDL scripts as determined by the supplied properties. |
| public static PersistenceUtil |
| PERSISTENCE_PROVIDER | back to summary |
|---|---|
| public static final String PERSISTENCE_PROVIDER
Deprecated
This final String is deprecated and should be removed and is only here for TCK backward compatibility
| |
| providers | back to summary |
|---|---|
| protected static final Set<PersistenceProvider> providers
Deprecated
This instance variable is deprecated and should be removed and is only here for TCK backward compatibility
| |
| Persistence | back to summary |
|---|---|
| public Persistence() | |
| createEntityManagerFactory | back to summary |
|---|---|
| public static EntityManagerFactory createEntityManagerFactory(String persistenceUnitName) Create and return an EntityManagerFactory for the named persistence unit.
| |
| createEntityManagerFactory | back to summary |
|---|---|
| public static EntityManagerFactory createEntityManagerFactory(String persistenceUnitName, Map<K, V> properties) Create and return an EntityManagerFactory for the named persistence unit using the given properties.
| |
| generateSchema | back to summary |
|---|---|
| public static void generateSchema(String persistenceUnitName, Map<K, V> map) Create database schemas and/or tables and/or create DDL scripts as determined by the supplied properties. Called when schema generation is to occur as a separate phase from creation of the entity manager factory.
| |
| getPersistenceUtil | back to summary |
|---|---|
| public static PersistenceUtil getPersistenceUtil() Return the PersistenceUtil instance
| |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public boolean | isLoaded(Object
entity containing the attribute entity, String name of attribute whose load state is
to be determined attributeName)Implements javax. |
| public boolean | isLoaded(Object
whose load state is to be determined entity)Implements javax. |
| PersistenceUtilImpl | back to summary |
|---|---|
| private PersistenceUtilImpl() | |
| isLoaded | back to summary |
|---|---|
| public boolean isLoaded(Object entity, String attributeName) Implements javax. Doc from javax. Determine the load state of a given persistent attribute. | |
| isLoaded | back to summary |
|---|---|
| public boolean isLoaded(Object entity) Implements javax. Doc from javax. Determine the load state of an entity.
This method can be used to determine the load state
of an entity passed as a reference. An entity is
considered loaded if all attributes for which
The
| |