|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.vaadin.addon.jpacontainer.JPAContainerFactory
public class JPAContainerFactory
A factory for creating instances of JPAContainers backed by different default entity providers.
| Constructor Summary | |
|---|---|
JPAContainerFactory()
|
|
| Method Summary | ||
|---|---|---|
static javax.persistence.EntityManager |
createEntityManagerForPersistenceUnit(String name)
Creates an EntityManager using the cached
EntityManagerFactory for the persistence unit. |
|
static
|
make(Class<T> entityClass,
javax.persistence.EntityManager entityManager)
Creates a new instance of JPAContainer backed by a CachingMutableLocalEntityProvider. |
|
static
|
make(Class<T> entityClass,
String persistenceUnitName)
Creates a new instance of a JPAContainer backed by a CachingMutableLocalEntityProvider. |
|
static
|
makeBatchable(Class<T> entityClass,
javax.persistence.EntityManager entityManager)
Creates a new instance of JPAContainer backed by a CachingBatchableLocalEntityProvider. |
|
static
|
makeBatchable(Class<T> entityClass,
String persistenceUnitName)
Creates a new instance of JPAContainer backed by a CachingBatchableLocalEntityProvider. |
|
static
|
makeBatchableJndi(Class<T> entityClass)
Creates a JPAContainer that uses JNDI lookups to fetch entity manager from "java:comp/env/persistence/em". |
|
static
|
makeBatchableJndi(Class<T> entityClass,
JndiAddresses jndiAddresses)
Creates a JPAContainer that uses JNDI lookups to fetch entity manager from "java:comp/env/persistence/em". |
|
static
|
makeJndi(Class<T> entityClass)
Creates a JPAContainer that uses JNDI lookups to fetch entity manager from "java:comp/env/persistence/em". |
|
static
|
makeJndi(Class<T> entityClass,
JndiAddresses jndiAddresses)
Creates a JPAContainer that uses JNDI lookups to fetch entity manager from "java:comp/env/persistence/em". |
|
static
|
makeNonCached(Class<T> entityClass,
javax.persistence.EntityManager entityManager)
Creates a new instance of JPAContainer backed by a MutableLocalEntityProvider. |
|
static
|
makeNonCached(Class<T> entityClass,
String persistenceUnitName)
Creates a new instance of JPAContainer backed by a MutableLocalEntityProvider. |
|
static
|
makeNonCachedJndi(Class<T> entityClass)
Creates a JPAContainer that uses JNDI lookups to fetch entity manager from "java:comp/env/persistence/em". |
|
static
|
makeNonCachedJndi(Class<T> entityClass,
JndiAddresses jndiAddresses)
Creates a JPAContainer that uses JNDI lookups to fetch entity manager from "java:comp/env/persistence/em". |
|
static
|
makeNonCachedReadOnly(Class<T> entityClass,
javax.persistence.EntityManager entityManager)
Creates a new instance of JPAContainer backed by a LocalEntityProvider. |
|
static
|
makeNonCachedReadOnly(Class<T> entityClass,
String persistenceUnitName)
Creates a new instance of JPAContainer backed by a LocalEntityProvider. |
|
static
|
makeNonCachedReadOnlyJndi(Class<T> entityClass)
Creates a JPAContainer that uses JNDI lookups to fetch entity manager from "java:comp/env/persistence/em". |
|
static
|
makeNonCachedReadOnlyJndi(Class<T> entityClass,
JndiAddresses jndiAddresses)
Creates a JPAContainer that uses JNDI lookups to fetch entity manager from "java:comp/env/persistence/em". |
|
static
|
makeReadOnly(Class<T> entityClass,
javax.persistence.EntityManager entityManager)
Creates a new instance of JPAContainer backed by a CachingLocalEntityProvider. |
|
static
|
makeReadOnly(Class<T> entityClass,
String persistenceUnitName)
Creates a new instance of JPAContainer backed by a CachingLocalEntityProvider. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JPAContainerFactory()
| Method Detail |
|---|
public static <T> JPAContainer<T> make(Class<T> entityClass,
javax.persistence.EntityManager entityManager)
CachingMutableLocalEntityProvider. This method should be used if
you already know an instance of EntityManager.
T - the type of entity to be contained in the JPAContainerentityClass - the class of the entityentityManager - the entity manager to use
public static <T> JPAContainer<T> make(Class<T> entityClass,
String persistenceUnitName)
CachingMutableLocalEntityProvider. This method can be used if you
do not know and do not need/want to know the instance of
EntityManager that is used, which is the case in simplistic
instances.
An instance of EntityManagerFactory will be created for the
persistence unit and used to build entity managers.
T - the type of entity to be contained in the JPAContainerentityClass - the class of the entitypersistenceUnitName - the persistency context to use to create entity managers
public static javax.persistence.EntityManager createEntityManagerForPersistenceUnit(String name)
EntityManager using the cached
EntityManagerFactory for the persistence unit. If no entity
manager factory exists, one is created before using it to build the
entity manager.
name - the name of the persistence unit.
public static <T> JPAContainer<T> makeReadOnly(Class<T> entityClass,
javax.persistence.EntityManager entityManager)
CachingLocalEntityProvider. This method should be used if you
already know an instance of EntityManager.
T - the type of entity to be contained in the JPAContainerentityClass - the class of the entityentityManager - the entity manager to use
public static <T> JPAContainer<T> makeReadOnly(Class<T> entityClass,
String persistenceUnitName)
CachingLocalEntityProvider. This method can be used if you do not
know and do not need/want to know the instance of EntityManager
that is used, which is the case in simplistic instances.
An instance of EntityManagerFactory will be created for the
persistence unit and used to build entity managers.
T - the type of entity to be contained in the JPAContainerentityClass - the class of the entitypersistenceUnitName - the persistency context to use to create entity managers
public static <T> JPAContainer<T> makeBatchable(Class<T> entityClass,
javax.persistence.EntityManager entityManager)
CachingBatchableLocalEntityProvider. This method should be used
if you already know an instance of EntityManager.
T - the type of entity to be contained in the JPAContainerentityClass - the class of the entityentityManager - the entity manager to use
public static <T> JPAContainer<T> makeBatchable(Class<T> entityClass,
String persistenceUnitName)
CachingBatchableLocalEntityProvider. This method can be used if
you do not know and do not need/want to know the instance of
EntityManager that is used, which is the case in simplistic
instances.
An instance of EntityManagerFactory will be created for the
persistence unit and used to build entity managers.
T - the type of entity to be contained in the JPAContainerentityClass - the class of the entitypersistenceUnitName - the persistency context to use to create entity managers
public static <T> JPAContainer<T> makeNonCached(Class<T> entityClass,
javax.persistence.EntityManager entityManager)
MutableLocalEntityProvider. This method should be used if you
already know an instance of EntityManager.
T - the type of entity to be contained in the JPAContainerentityClass - the class of the entityentityManager - the entity manager to use
public static <T> JPAContainer<T> makeNonCached(Class<T> entityClass,
String persistenceUnitName)
MutableLocalEntityProvider. This method can be used if you do not
know and do not need/want to know the instance of EntityManager
that is used, which is the case in simplistic instances.
An instance of EntityManagerFactory will be created for the
persistence unit and used to build entity managers.
T - the type of entity to be contained in the JPAContainerentityClass - the class of the entitypersistenceUnitName - the persistency context to use to create entity managers
public static <T> JPAContainer<T> makeNonCachedReadOnly(Class<T> entityClass,
javax.persistence.EntityManager entityManager)
LocalEntityProvider. This method should be used if you already
know an instance of EntityManager.
T - the type of entity to be contained in the JPAContainerentityClass - the class of the entityentityManager - the entity manager to use
public static <T> JPAContainer<T> makeNonCachedReadOnly(Class<T> entityClass,
String persistenceUnitName)
LocalEntityProvider. This method can be used if you do not know
and do not need/want to know the instance of EntityManager that
is used, which is the case in simplistic instances.
An instance of EntityManagerFactory will be created for the
persistence unit and used to build entity managers.
T - the type of entity to be contained in the JPAContainerentityClass - the class of the entitypersistenceUnitName - the persistency context to use to create entity managers
public static <T> JPAContainer<T> makeNonCachedReadOnlyJndi(Class<T> entityClass)
T - the type of entity to be contained in the JPAContainerentityClass - the class of the entity
public static <T> JPAContainer<T> makeNonCachedReadOnlyJndi(Class<T> entityClass,
JndiAddresses jndiAddresses)
T - the type of entity to be contained in the JPAContainerentityClass - the class of the entityjndiAddresses - to be used to get references to EntityManager and
UserTransaction
public static <T> JPAContainer<T> makeNonCachedJndi(Class<T> entityClass)
T - the type of entity to be contained in the JPAContainerentityClass - the class of the entity
public static <T> JPAContainer<T> makeNonCachedJndi(Class<T> entityClass,
JndiAddresses jndiAddresses)
T - the type of entity to be contained in the JPAContainerentityClass - the class of the entityjndiAddresses - to be used to get references to EntityManager and
UserTransaction
public static <T> JPAContainer<T> makeJndi(Class<T> entityClass)
T - the type of entity to be contained in the JPAContainerentityClass - the class of the entity
public static <T> JPAContainer<T> makeJndi(Class<T> entityClass,
JndiAddresses jndiAddresses)
T - the type of entity to be contained in the JPAContainerentityClass - the class of the entityjndiAddresses - to be used to get references to EntityManager and
UserTransaction
public static <T> JPAContainer<T> makeBatchableJndi(Class<T> entityClass)
T - the type of entity to be contained in the JPAContainerentityClass - the class of the entity
public static <T> JPAContainer<T> makeBatchableJndi(Class<T> entityClass,
JndiAddresses jndiAddresses)
T - the type of entity to be contained in the JPAContainerentityClass - the class of the entityjndiAddresses - to be used to get references to EntityManager and
UserTransaction
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||