|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectit.amattioli.dominate.hibernate.AbstractHibernateRepository<I,T>
it.amattioli.dominate.hibernate.ClassHibernateRepository<I,T>
T - The class of the objects that can be accessed using this repositoryI - The class of the identifier of the objects that can be accessed using this repositorypublic class ClassHibernateRepository<I extends Serializable,T extends Entity<I>>
A repository to access all the entities of a certain class persisted with Hibernate.
| Constructor Summary | |
|---|---|
ClassHibernateRepository(Class<T> repositoryClass)
Create a repository for the entities whose class is passed as parameter |
|
| Method Summary | ||
|---|---|---|
protected void |
addOrder(org.hibernate.Criteria crit)
|
|
protected String |
addOrder(String hqlQuery)
|
|
protected org.hibernate.Criteria |
defaultCriteria()
|
|
void |
fillCollection(Collection<? super T>... toBeFilled)
|
|
void |
fillCollection(Filter criteria,
Collection<? super T>... toBeFilled)
Deprecated. |
|
T |
get(I id)
Retrieve an entity from this repository using its id. |
|
|
getDetailRepository(Collection<E> details)
|
|
Filter |
getLastCriteria()
Deprecated. |
|
Class<T> |
getRepositoryClass()
Retrieves the class of the entities that can be accessed using this repository |
|
protected void |
inMemoryOrder(List<T> result)
|
|
boolean |
isCacheable()
|
|
boolean |
isDbOrder()
|
|
boolean |
isRemoveAllowed()
Check if this repository supports object removal. |
|
List<T> |
list()
Retrieves all the objects contained in this repository. |
|
List<T> |
list(Filter criteria)
Deprecated. |
|
List<T> |
list(Specification<T> spec)
Retrieves the objects contained in this repository that satisfied the given specification. |
|
void |
put(T object)
Add a new entity to this repository. |
|
void |
refresh(I objectId)
If this repository is associated to an external data source (i.e a relational database) this method delete an object from the repository local cache so that a Repository.get(Serializable) will retrieve a fresh
one from the data source. |
|
void |
refresh(T object)
If this repository is associated to an external data source (i.e a relational database) this method delete an object from the repository local cache so that a Repository.get(Serializable) will retrieve a fresh
one from the data source. |
|
void |
remove(I objectId)
Removes an object from this repository. |
|
void |
remove(T object)
Removes an object from this repository. |
|
void |
setCacheable(boolean cacheable)
|
|
void |
setDbOrder(boolean dbOrder)
|
|
String |
toString()
|
|
| Methods inherited from class it.amattioli.dominate.hibernate.AbstractHibernateRepository |
|---|
addOrder, clone, getByPropertyValue, getFirst, getHibernateSession, getHqlOrder, getLast, getOrderProperty, getOrders, getSessionManager, isReverseOrder, removeLastOrder, setFirst, setLast, setOrder, setSessionManager |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ClassHibernateRepository(Class<T> repositoryClass)
repositoryClass - the class of the entities that can be accessed
using this repository| Method Detail |
|---|
public Class<T> getRepositoryClass()
public T get(I id)
Repository
id - the id of the entity you want to retrieve.
public void put(T object)
Repository
object - the entity you want to addpublic void refresh(I objectId)
RepositoryRepository.get(Serializable) will retrieve a fresh
one from the data source.
If the repository is not associated to an external data source or it
has no local cache this method will have no effect.
objectId - the id of the object to be refreshedpublic void refresh(T object)
RepositoryRepository.get(Serializable) will retrieve a fresh
one from the data source.
If the repository is not associated to an external data source or it
has no local cache this method will have no effect.
object - the object to be refreshedpublic boolean isRemoveAllowed()
Repository
public void remove(I objectId)
RepositoryRepository.isRemoveAllowed()
objectId - the id of the object to removepublic void remove(T object)
RepositoryRepository.isRemoveAllowed()
object - the object to removeprotected org.hibernate.Criteria defaultCriteria()
public boolean isDbOrder()
public void setDbOrder(boolean dbOrder)
protected String addOrder(String hqlQuery)
protected void addOrder(org.hibernate.Criteria crit)
protected void inMemoryOrder(List<T> result)
public List<T> list()
Repository
#setFirst(int)}, {@link #setLast(int)}, {@link #setOrder(String, boolean)}@Deprecated public List<T> list(Filter criteria)
Repository
criteria - the filter to be used
#setFirst(int)}, {@link #setLast(int)}, {@link #setOrder(String, boolean)}public List<T> list(Specification<T> spec)
Repository
spec - the specification that must be satisfied
@Deprecated public Filter getLastCriteria()
public <J extends Serializable,E extends Entity<J>> Repository<J,E> getDetailRepository(Collection<E> details)
public boolean isCacheable()
public void setCacheable(boolean cacheable)
@Deprecated
public void fillCollection(Filter criteria,
Collection<? super T>... toBeFilled)
public void fillCollection(Collection<? super T>... toBeFilled)
public String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||