public final class JpaUtils extends Object
| Modifier and Type | Field and Description |
|---|---|
static String |
DELETE_ALL_QUERY_STRING |
| Modifier and Type | Method and Description |
|---|---|
static <T> Query |
applyAndBind(String queryString,
Iterable<T> entities,
EntityManager entityManager)
Creates a where-clause referencing the given entities and appends it to the given query string.
|
static String |
detectAlias(String query)
Resolves the alias for the entity to be retrieved from the given JPA query.
|
static String |
getEntityName(EntityManager em,
Class<?> entityClass) |
static String |
getQueryString(String template,
String entityName)
Returns the query string for the given class name.
|
public static final String DELETE_ALL_QUERY_STRING
public static String detectAlias(String query)
query - The query.public static <T> Query applyAndBind(String queryString, Iterable<T> entities, EntityManager entityManager)
T - The entity type.queryString - The query string.entities - The entities.entityManager - The entity manager.public static String getQueryString(String template, String entityName)
template - The template.entityName - The entity name.public static String getEntityName(EntityManager em, Class<?> entityClass)