public class JpaUtil extends Object
| Constructor and Description |
|---|
JpaUtil() |
| Modifier and Type | Method and Description |
|---|---|
static <T> List<T> |
findAll(Class<T> type,
javax.persistence.EntityManager entityManager) |
static Principal |
findPrincipal()
Looks for principal in CDI
|
static Optional<EntityInterface> |
fromException(Throwable ex)
looks for an EntityInterface in a EntityException or ConstraintViolationException
(in the first ConstraintViolation).
|
static javax.persistence.EntityManagerFactory |
getEntityManagerFactory(String name)
return a cached EntityManagerFactory, make sure you close it when it is not needed anymore.
|
public static javax.persistence.EntityManagerFactory getEntityManagerFactory(String name)
name - public static Principal findPrincipal() throws IllegalStateException
IllegalStateExceptionpublic static <T> List<T> findAll(Class<T> type, javax.persistence.EntityManager entityManager)
public static Optional<EntityInterface> fromException(Throwable ex)
ex - Copyright © 2018–2021 Fryske Akademy. All rights reserved.