public interface BaseJpaDao
| Modifier and Type | Method and Description |
|---|---|
<T> void |
delete(T entity)
Deletes an entity.
|
<T> void |
detach(T entity)
Detaches an entity.
|
<T> List<T> |
findAll(Class<T> entityClass)
Gets a list of entities based on the entity class.
|
<T> T |
findById(Class<T> entityClass,
Object entityId)
Get an entity based on its class and entity Id.
|
<T> List<T> |
findByNamedProperties(Class<T> entityClass,
Map<String,?> params)
Finds a collection of entities based on an entity class name and named parameters.
|
<T> T |
findUniqueByNamedProperties(Class<T> entityClass,
Map<String,?> params)
Finds an entity based on an entity class name and named parameters.
|
Timestamp |
getCurrentTimestamp()
Gets the current timestamp.
|
javax.persistence.EntityManager |
getEntityManager()
Gets the entity manager instance.
|
<T> List<T> |
query(String queryString)
Executes a query string and returns the results.
|
<T> List<T> |
queryByNamedParams(String queryString,
Map<String,?> params)
Executes a query string with a named set of parameters.
|
<T> T |
save(T entity)
Saves an entity.
|
<T> T |
saveAndRefresh(T entity)
Saves, flushes, and refreshes an entity.
|
javax.persistence.EntityManager getEntityManager()
<T> T findById(Class<T> entityClass, Object entityId)
T - the type of class.entityClass - the entity class.entityId - the entity Id.<T> List<T> findAll(Class<T> entityClass)
T - the type of class.entityClass - the entity class.<T> List<T> findByNamedProperties(Class<T> entityClass, Map<String,?> params)
T - the type of class.entityClass - the entity class to retrieve.params - the named parameters.<T> T findUniqueByNamedProperties(Class<T> entityClass, Map<String,?> params)
T - the type of class.entityClass - the entity class to retrieve.params - the named parameters.<T> List<T> queryByNamedParams(String queryString, Map<String,?> params)
T - the type of class to be returned.queryString - the query string.params - the named parameter map.<T> List<T> query(String queryString)
T - the type of entity being returned.queryString - the query string.<T> T save(T entity)
T - the type of entity.entity - the entity to save.<T> T saveAndRefresh(T entity)
T - the type of entity.entity - the entity to save.<T> void delete(T entity)
T - the type of entity.entity - the entity to delete.<T> void detach(T entity)
T - the type of entity.entity - the entity to detach.Timestamp getCurrentTimestamp()
Copyright © 2019. All rights reserved.