|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.springframework.dao.support.DaoSupport
org.springframework.orm.hibernate3.support.HibernateDaoSupport
org.ow2.dragon.persistence.dao.UniversalHibernateDAOImpl
public class UniversalHibernateDAOImpl
This class serves as the a class that can CRUD any object witout any Spring configuration. The only downside is it does require casting from Object to the object class.
| Field Summary |
|---|
| Fields inherited from class org.springframework.dao.support.DaoSupport |
|---|
logger |
| Constructor Summary | |
|---|---|
UniversalHibernateDAOImpl()
|
|
| Method Summary | |
|---|---|
int |
count(java.lang.Class clazz,
com.trg.search.IMutableSearch search)
Returns the total number of results that would be returned using the given ISearch if there were no paging or maxResult limits. |
boolean |
exists(java.lang.Class clazz,
java.io.Serializable id)
Checks for existence of an object of type T using the id arg. |
java.util.List |
findByNamedQuery(java.lang.String queryName,
java.util.Map<java.lang.String,java.lang.Object> queryParams)
Find a list of records by using a named query |
java.lang.Object |
get(java.lang.Class clazz,
java.io.Serializable id)
Generic method to get an object based on class and identifier. |
java.util.List |
getAll(java.lang.Class clazz)
Generic method used to get all objects of a particular type. |
java.util.List |
getAll(java.lang.Class clazz,
java.util.List ids)
Retrieve a List of entities matching given ids |
java.util.List |
getAll(java.lang.Class clazz,
java.util.List ids,
RequestOptions requestOptions)
Retrieve a List of entities matching given ids, sorted and
paginated according to the given request options |
java.util.List |
getAll(java.lang.Class clazz,
RequestOptions requestOptions)
Generic method used to get all objects of a particular type, sorted and paginated according to the given request options. |
java.lang.Object |
merge(java.lang.Object o)
|
java.lang.Object |
persist(java.lang.Object o)
|
void |
remove(java.lang.Class clazz,
java.io.Serializable id)
Generic method to delete an object based on class and id |
void |
remove(java.lang.Object object)
Generic method to delete an object |
void |
removeAll(java.lang.Class clazz,
java.util.List ids)
Generic method to delete all object based on class and ids list |
void |
removeAll(java.util.List objects)
|
java.lang.Object |
save(java.lang.Object o)
Generic method to save an object - handles both update and insert. |
java.lang.Object |
saveOnly(java.lang.Object o)
|
java.util.List |
search(java.lang.Class clazz,
com.trg.search.IMutableSearch search)
Search for objects based on the search parameters in the specified ISearch object. |
com.trg.search.SearchResult |
searchAndCount(java.lang.Class clazz,
com.trg.search.IMutableSearch search)
Returns a SearchResult object that includes the list of
results like search() and the total length like
searchLength. |
java.util.List |
searchEquals(java.lang.Class clazz,
java.lang.String[] criteria,
java.lang.String[] properties,
RequestOptions requestOptions)
This method allows to search Objects on String properties, fitting search criteria. |
java.util.List |
searchLike(java.lang.Class clazz,
java.lang.String[] criteria,
java.lang.String[] properties,
RequestOptions requestOptions)
This method allows to search Objects on String properties, fitting search criteria. |
java.lang.Object |
searchUnique(java.lang.Class clazz,
com.trg.search.IMutableSearch search)
Search for a single result using the given parameters. |
java.lang.Object |
updateOnly(java.lang.Object o)
|
| Methods inherited from class org.springframework.orm.hibernate3.support.HibernateDaoSupport |
|---|
checkDaoConfig, convertHibernateAccessException, createHibernateTemplate, getHibernateTemplate, getSession, getSession, getSessionFactory, releaseSession, setHibernateTemplate, setSessionFactory |
| Methods inherited from class org.springframework.dao.support.DaoSupport |
|---|
afterPropertiesSet, initDao |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public UniversalHibernateDAOImpl()
| Method Detail |
|---|
public java.lang.Object save(java.lang.Object o)
save in interface UniversalORMDAOo - the object to save
public java.lang.Object get(java.lang.Class clazz,
java.io.Serializable id)
get in interface UniversalORMDAOclazz - model class to lookupid - the identifier (primary key) of the class
public java.util.List getAll(java.lang.Class clazz)
getAll in interface UniversalORMDAOclazz - the type of objects (a.k.a. while table) to get data from
public void remove(java.lang.Class clazz,
java.io.Serializable id)
remove in interface UniversalORMDAOclazz - model class to lookupid - the identifier (primary key) of the classpublic void remove(java.lang.Object object)
remove in interface UniversalORMDAOobject - the object to remove
public java.util.List getAll(java.lang.Class clazz,
java.util.List ids)
List of entities matching given ids
getAll in interface UniversalORMDAOclazz - model class to lookupids - a List of ids
List of entities matching ids, must be non null, could
be empty
public java.util.List getAll(java.lang.Class clazz,
java.util.List ids,
RequestOptions requestOptions)
List of entities matching given ids, sorted and
paginated according to the given request options
getAll in interface UniversalORMDAOclazz - model class to lookupids - a List of idsrequestOptions - include sort order and pagination information
List of entities matching ids, must be
non null, could be empty
public java.util.List getAll(java.lang.Class clazz,
RequestOptions requestOptions)
getAll in interface UniversalORMDAOclazz - model class to lookuprequestOptions - include sort order and pagination information
public void removeAll(java.lang.Class clazz,
java.util.List ids)
removeAll in interface UniversalORMDAOclazz - model class to lookupids - the identifiers (primary key) of object to deletepublic void removeAll(java.util.List objects)
removeAll in interface UniversalORMDAO
public java.util.List searchEquals(java.lang.Class clazz,
java.lang.String[] criteria,
java.lang.String[] properties,
RequestOptions requestOptions)
searchEquals in interface UniversalORMDAOclazz - model class to lookupcriteria - the search criteriaproperties - the searched propertiesrequestOptions - include sort order and pagination information
public java.util.List searchLike(java.lang.Class clazz,
java.lang.String[] criteria,
java.lang.String[] properties,
RequestOptions requestOptions)
searchLike in interface UniversalORMDAOclazz - model class to lookupcriteria - the search criteriaproperties - the searched propertiesrequestOptions - include sort order and pagination information
public java.util.List search(java.lang.Class clazz,
com.trg.search.IMutableSearch search)
ISearch object.
search in interface UniversalORMDAOISearch
public int count(java.lang.Class clazz,
com.trg.search.IMutableSearch search)
ISearch if there were no paging or maxResult limits.
count in interface UniversalORMDAOISearch
public com.trg.search.SearchResult searchAndCount(java.lang.Class clazz,
com.trg.search.IMutableSearch search)
SearchResult object that includes the list of
results like search() and the total length like
searchLength.
searchAndCount in interface UniversalORMDAOISearch
public java.lang.Object searchUnique(java.lang.Class clazz,
com.trg.search.IMutableSearch search)
throws org.hibernate.NonUniqueResultException
searchUnique in interface UniversalORMDAOorg.hibernate.NonUniqueResultException
public boolean exists(java.lang.Class clazz,
java.io.Serializable id)
exists in interface UniversalORMDAOid - the id of the entity
public java.util.List findByNamedQuery(java.lang.String queryName,
java.util.Map<java.lang.String,java.lang.Object> queryParams)
findByNamedQuery in interface UniversalORMDAOqueryName - query name of the named queryqueryParams - a map of the query names and the values
public java.lang.Object merge(java.lang.Object o)
merge in interface UniversalORMDAOpublic java.lang.Object persist(java.lang.Object o)
persist in interface UniversalORMDAOpublic java.lang.Object saveOnly(java.lang.Object o)
saveOnly in interface UniversalORMDAOpublic java.lang.Object updateOnly(java.lang.Object o)
updateOnly in interface UniversalORMDAO
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||