E - the entity typeI - the id typepublic abstract class EntityDAOHibernate<E extends IEntity<I>,I> extends Object implements IEntityDAO<E,I>
| Modifier and Type | Field and Description |
|---|---|
protected javax.persistence.EntityManager |
entityManager |
| Constructor and Description |
|---|
EntityDAOHibernate() |
| Modifier and Type | Method and Description |
|---|---|
void |
delete(E element) |
void |
deleteById(I id) |
E |
findById(I id) |
protected E |
findByQuery(String query,
Object... params) |
protected Object[] |
findGenericByQuery(String query,
Object... params) |
protected List<Object[]> |
findGenericListByQuery(String query,
Object... params) |
protected List<Object[]> |
findGenericListByQueryLimit(String query,
int first,
int max,
Object... params) |
List<E> |
findList() |
List<E> |
findList(int first,
int max) |
protected List<E> |
findListByQuery(String query,
Object... params) |
protected List<E> |
findListByQueryLimit(String query,
int first,
int max,
Object... params) |
protected String |
getFindListQuery()
Override in sub-class if not "FROM 'EntityName'"
|
protected String |
getIdField()
Override in sub-class if not "id"
|
E |
save(E element) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitgetEntityClass@Transactional public void delete(E element)
@Transactional public void deleteById(I id)
deleteById in interface IEntityDAO<E extends IEntity<I>,I>id - the id of the element to deleteprotected final E findByQuery(String query, Object... params)
query - the JPA queryparams - the positional parametersprotected final Object[] findGenericByQuery(String query, Object... params)
query - the JPA queryparams - the positional parametersprotected final List<Object[]> findGenericListByQuery(String query, Object... params)
protected final List<Object[]> findGenericListByQueryLimit(String query, int first, int max, Object... params)
protected final List<E> findListByQueryLimit(String query, int first, int max, Object... params)
protected String getIdField()
protected String getFindListQuery()
Copyright © 2015–2016 Taimos GmbH. All rights reserved.