|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectru.sstu.dao.AbstractDao<T>
T - concrete entity classpublic abstract class AbstractDao<T extends Serializable>
AbstractDao class contains generic methods for data access.
| Constructor Summary | |
|---|---|
protected |
AbstractDao()
Initializes DAO properties. |
| Method Summary | |
|---|---|
protected Number |
aggregate(org.hibernate.criterion.DetachedCriteria criteria)
Provides result of aggregate function in query. |
protected void |
delete(org.hibernate.criterion.DetachedCriteria criteria)
Deletes entities by criteria. |
void |
delete(List<T> entities)
delete method removes existing entities. |
protected void |
delete(Object entity)
Deletes entity which is not of type T. |
void |
delete(T entity)
Removes entity. |
List<T> |
find()
Returns all entities from data source. |
T |
findById(Serializable id)
Returns entity with given id. |
protected org.hibernate.criterion.DetachedCriteria |
getCriteria()
Provides search criteria which can be used for searches with criteria. |
protected abstract org.springframework.orm.hibernate3.HibernateTemplate |
getTemplate()
Provides actual HibernateTemplate object. |
protected List<T> |
hql(String query)
Executes HQL query. |
protected List<T> |
hql(String query,
Object... values)
Executes HQL query. |
protected List<T> |
hql(String query,
Object value)
Executes HQL query. |
protected List<T> |
list(org.hibernate.criterion.DetachedCriteria criteria)
Provides list of entities. |
void |
save(List<T> entities)
save method saves list of entities. |
protected void |
save(Object entity)
Saves entity which is not of type T. |
void |
save(T entity)
Saves entity. |
protected T |
unique(org.hibernate.criterion.DetachedCriteria criteria)
Provides unique entity with given criteria. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
protected AbstractDao()
| Method Detail |
|---|
public List<T> find()
find in interface ReadOnlyDao<T extends Serializable>public T findById(Serializable id)
findById in interface ReadOnlyDao<T extends Serializable>id - entity's id
public void save(T entity)
save in interface Dao<T extends Serializable>entity - entitypublic void save(List<T> entities)
save method saves list of entities.
save in interface Dao<T extends Serializable>entities - entities for savingpublic void delete(T entity)
delete in interface Dao<T extends Serializable>entity - entitypublic void delete(List<T> entities)
delete method removes existing entities.
delete in interface Dao<T extends Serializable>entities - entities to be deletedprotected org.hibernate.criterion.DetachedCriteria getCriteria()
protected T unique(org.hibernate.criterion.DetachedCriteria criteria)
criteria - criteria
protected List<T> list(org.hibernate.criterion.DetachedCriteria criteria)
criteria - search criteria
protected Number aggregate(org.hibernate.criterion.DetachedCriteria criteria)
criteria - criteria
protected List<T> hql(String query)
query - query
protected List<T> hql(String query,
Object value)
query - queryvalue - value
protected List<T> hql(String query,
Object... values)
query - queryvalues - values
protected void save(Object entity)
T.
entity - entity to be savedprotected void delete(Object entity)
T.
entity - entity to be deletedprotected void delete(org.hibernate.criterion.DetachedCriteria criteria)
criteria - criteria for entities to be deletedprotected abstract org.springframework.orm.hibernate3.HibernateTemplate getTemplate()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||