T - Type of repository objects - accessable via getType()public class GenericRepository<T> extends Object
| Modifier and Type | Field and Description |
|---|---|
protected javax.persistence.EntityManager |
entityManager |
protected SessionTemplateFactory |
sessionTemplateFactory |
protected RepositoryTransactionPool |
transactionPool |
| Constructor and Description |
|---|
GenericRepository() |
GenericRepository(Class<T> persistentClass) |
| Modifier and Type | Method and Description |
|---|---|
void |
asyncDelete(Collection<T> entities) |
void |
asyncDelete(T... entities) |
void |
asyncDelete(T entity) |
void |
asyncMerge(Collection<T> entities) |
void |
asyncMerge(T... entities) |
void |
asyncMerge(T entity) |
void |
asyncPersist(Collection<T> entities) |
void |
asyncPersist(T... entities) |
void |
asyncPersist(T entity) |
void |
asyncRefresh(Collection<T> entities) |
void |
asyncRefresh(T... entities) |
void |
asyncRefresh(T entity) |
void |
asyncSave(Collection<T> entities) |
void |
asyncSave(T... entities) |
void |
asyncSave(T entity) |
void |
asyncSaveOrUpdate(Collection<T> entities) |
void |
asyncSaveOrUpdate(T... entities) |
void |
asyncSaveOrUpdate(T entity) |
void |
delete(T entity) |
Collection<T> |
getAll() |
Collection<T> |
getAll(int maxResults) |
void |
getAll(int maxResults,
Consumer<Collection<T>> collectionConsumer) |
T |
getById(Serializable id) |
void |
getByIds(Collection<Serializable> ids,
Consumer<Stream<T>> streamConsumer) |
protected String |
getIdFieldName() |
Map<Date,T> |
getOlderVersions(Object id) |
org.hibernate.Session |
getSession() |
Class<T> |
getType() |
T |
merge(T entity) |
void |
persist(T entity) |
void |
process(Consumer<SessionTemplate> consumer) |
void |
refresh(T entity) |
void |
save(T entity) |
void |
saveOrUpdate(T entity) |
String |
toString() |
protected javax.persistence.EntityManager entityManager
@Autowired protected RepositoryTransactionPool transactionPool
@Autowired protected SessionTemplateFactory sessionTemplateFactory
public org.hibernate.Session getSession()
protected String getIdFieldName()
public String toString()
toString in class ObjectObject.toString()public void process(Consumer<SessionTemplate> consumer)
@Transactional public void persist(T entity)
@Transactional public void refresh(T entity)
@Transactional public void save(T entity)
@Transactional public void saveOrUpdate(T entity)
@Transactional public void delete(T entity)
@Transactional public T getById(Serializable id)
public void getByIds(Collection<Serializable> ids, Consumer<Stream<T>> streamConsumer)
public void getAll(int maxResults,
Consumer<Collection<T>> collectionConsumer)
public Collection<T> getAll()
public Collection<T> getAll(int maxResults)
public void asyncPersist(T entity)
public void asyncRefresh(T entity)
public void asyncMerge(T entity)
public void asyncSave(T entity)
public void asyncSaveOrUpdate(T entity)
public void asyncDelete(T entity)
public void asyncPersist(Collection<T> entities)
public void asyncRefresh(Collection<T> entities)
public void asyncMerge(Collection<T> entities)
public void asyncSave(Collection<T> entities)
public void asyncSaveOrUpdate(Collection<T> entities)
public void asyncDelete(Collection<T> entities)
public void asyncPersist(T... entities)
public void asyncRefresh(T... entities)
public void asyncMerge(T... entities)
public void asyncSave(T... entities)
public void asyncSaveOrUpdate(T... entities)
public void asyncDelete(T... entities)
Copyright © 2014–2015. All rights reserved.