|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.squashtest.csp.tm.internal.repository.hibernate.HibernateDao<ENTITY_TYPE>
public abstract class HibernateDao<ENTITY_TYPE>
To implement an Hibernate DAO, subclass this class, annotate it with @Repository and work with the Hibernate session
provided by currentSession()
| Field Summary | |
|---|---|
protected Class<ENTITY_TYPE> |
entityType
|
| Constructor Summary | |
|---|---|
HibernateDao()
|
|
| Method Summary | ||
|---|---|---|
protected org.hibernate.Session |
currentSession()
|
|
protected
|
executeEntityNamedQuery(String queryName,
SetQueryParametersCallback setParams)
Runs a named query which returns a single entity / tuple / scalar and which accepts a unique parameter. |
|
protected
|
executeListNamedQuery(String queryName)
Executes a no-args named query which returns a list of entities. |
|
protected
|
executeListNamedQuery(String queryName,
Object queryParam,
CollectionFilter filter)
Executes a named query with parameters. |
|
protected
|
executeListNamedQuery(String queryName,
SetQueryParametersCallback setParams)
Executes a named query with parameters. |
|
protected ENTITY_TYPE |
getEntity(long objectId)
|
|
protected void |
persistEntity(Object entity)
|
|
protected void |
removeEntity(ENTITY_TYPE entity)
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final Class<ENTITY_TYPE> entityType
| Constructor Detail |
|---|
public HibernateDao()
| Method Detail |
|---|
protected final org.hibernate.Session currentSession()
protected final ENTITY_TYPE getEntity(long objectId)
protected final void persistEntity(Object entity)
protected final <R> List<R> executeListNamedQuery(String queryName)
R - queryName -
protected final <R> List<R> executeListNamedQuery(String queryName,
SetQueryParametersCallback setParams)
R - queryName - setParams -
protected final <R> List<R> executeListNamedQuery(@NotNull
String queryName,
@NotNull
Object queryParam,
@NotNull
CollectionFilter filter)
R - queryName - queryParam - unique param of the queryfilter - collection filter used to restrict the number of results.
protected final <R> R executeEntityNamedQuery(String queryName,
SetQueryParametersCallback setParams)
R - queryName - name of the query, should not be nullparamName - name of the parameter, should not be nullparamValue - value of the parameter, should not be null
protected final void removeEntity(ENTITY_TYPE entity)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||