|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object dk.netarkivet.wayback.indexer.GenericHibernateDAO<T,PK>
T
- The type of the persistent entity.PK
- The type of the primary key for the entity.public class GenericHibernateDAO<T,PK extends java.io.Serializable>
An implementation of Generic DAO which is specialised for hibernate object stores.
Constructor Summary | |
---|---|
GenericHibernateDAO(java.lang.Class<T> type)
Constructor for the class. |
Method Summary | |
---|---|
PK |
create(T o)
Persist the newInstance object into database. |
void |
delete(T o)
Remove an object from persistent storage in the database. |
protected java.util.List<T> |
findByCriteria(org.hibernate.criterion.Criterion... criterion)
Use this inside subclasses as a convenience method to find objects matching a given criterion. |
protected org.hibernate.Session |
getSession()
Return a session object for managing instances of this class. |
T |
read(PK id)
Retrieve an object that was previously persisted to the database using the indicated id as primary key. |
void |
update(T o)
Save changes made to a persistent object. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public GenericHibernateDAO(java.lang.Class<T> type)
type
- the type of the persistent entity managed by this class.Method Detail |
---|
public PK create(T o)
GenericDAO
create
in interface GenericDAO<T,PK extends java.io.Serializable>
o
- the object to persist.
public T read(PK id)
GenericDAO
read
in interface GenericDAO<T,PK extends java.io.Serializable>
id
- the key of the object to be retrieved.
public void update(T o)
GenericDAO
update
in interface GenericDAO<T,PK extends java.io.Serializable>
o
- the object to be updated.public void delete(T o)
GenericDAO
delete
in interface GenericDAO<T,PK extends java.io.Serializable>
o
- the object to be deleted.protected org.hibernate.Session getSession()
protected java.util.List<T> findByCriteria(org.hibernate.criterion.Criterion... criterion)
criterion
- the criteria to be matched.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |