public interface JPAApi
| Modifier and Type | Method and Description |
|---|---|
javax.persistence.EntityManager |
em(java.lang.String name)
Get the EntityManager for the specified persistence unit name.
|
void |
shutdown()
Close all entity manager factories.
|
JPAApi |
start()
Initialise JPA entity manager factories.
|
void |
withTransaction(java.lang.Runnable block)
Run a block of code in a JPA transaction.
|
<T> T |
withTransaction(java.lang.String name,
boolean readOnly,
java.util.function.Supplier<T> block)
Run a block of code in a JPA transaction.
|
<T> T |
withTransaction(java.util.function.Supplier<T> block)
Run a block of code in a JPA transaction.
|
<T> F.Promise<T> |
withTransactionAsync(java.lang.String name,
boolean readOnly,
java.util.function.Supplier<F.Promise<T>> block)
Deprecated.
This may cause deadlocks
|
<T> F.Promise<T> |
withTransactionAsync(java.util.function.Supplier<F.Promise<T>> block)
Deprecated.
This may cause deadlocks
|
JPAApi start()
javax.persistence.EntityManager em(java.lang.String name)
name - The persistence unit name<T> T withTransaction(java.util.function.Supplier<T> block)
T - type of resultblock - Block of code to execute@Deprecated <T> F.Promise<T> withTransactionAsync(java.util.function.Supplier<F.Promise<T>> block)
T - type of resultblock - Block of code to executevoid withTransaction(java.lang.Runnable block)
block - Block of code to execute<T> T withTransaction(java.lang.String name,
boolean readOnly,
java.util.function.Supplier<T> block)
T - type of resultname - The persistence unit namereadOnly - Is the transaction read-only?block - Block of code to execute@Deprecated <T> F.Promise<T> withTransactionAsync(java.lang.String name, boolean readOnly, java.util.function.Supplier<F.Promise<T>> block)
T - type of resultname - The persistence unit namereadOnly - Is the transaction read-only?block - Block of code to execute.void shutdown()