|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface GenericUnifiedDAO<T,PK extends java.io.Serializable>
An generic unified DAO that could be specialized to manage a specific Dragon entities. Unifies Compass and Hibernate apis. All method parameters must not be null by default.
| Method Summary | |
|---|---|
int |
count(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(PK id)
Checks for existence of an object of type T using the id arg. |
java.util.List<T> |
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 |
T |
get(PK id)
Return the persistent instance of an entity with the given identifier, or null if not found. |
java.util.List<T> |
getAll()
Generic method used to get all objects of a particular type. |
java.util.List<T> |
getAll(java.util.List<PK> ids)
Retrieve a List of entities matching given ids |
java.util.List<T> |
getAll(java.util.List<PK> ids,
RequestOptions requestOptions)
Retrieve a List of entities matching given ids, sorted and
paginated according to the given request options |
java.util.List<T> |
getAll(RequestOptions requestOptions)
Generic method used to get all objects of a particular type, sorted and paginated according to the given request options. |
java.util.List<T> |
getAllDistinct()
Gets all records without duplicates. |
void |
remove(PK id)
Generic method to delete an object based on class and id |
void |
remove(T object)
Generic method to delete an object |
T |
save(T object)
Generic method to save an object - handles both update and insert. |
java.util.List<T> |
search(com.trg.search.IMutableSearch search)
Search for objects based on the search parameters in the specified ISearch object. |
java.util.List<T> |
search(java.lang.String query)
Return a List of entity managed by the Full Text Search Engine
(Compass etc.). |
com.trg.search.SearchResult<T> |
searchAndCount(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<T> |
searchEquals(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<T> |
searchLike(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<T> |
searchORMResult(java.lang.String query)
Process a research on Full Text Search Engine (Compass etc.) index and return a List of entity managed by the ORM engine (Hibernate,
iBatis etc.). |
java.util.List<T> |
searchORMResult(java.lang.String[] criteria,
java.lang.String[] searchedProperties)
This method allows to search Objects on String properties, fitting search criteria. |
java.util.List<T> |
searchORMResult(java.lang.String[] criteria,
java.lang.String[] searchedProperties,
RequestOptions requestOptions)
This method allows to search Objects on String properties, fitting search criteria. |
java.util.List<T> |
searchORMResult(java.lang.String query,
RequestOptions requestOptions)
Process a research on Full Text Search Engine (Compass etc.) index and return a List of entity managed by the ORM engine (Hibernate,
iBatis etc.), sorted and paginated according to the given request
options. |
T |
searchUnique(com.trg.search.IMutableSearch search)
Search for a single result using the given parameters. |
| Method Detail |
|---|
java.util.List<T> getAll(RequestOptions requestOptions)
requestOptions - include sort order and pagination information, could be null
java.util.List<T> getAll()
T get(PK id)
null if not found.
id - the identifier of the persistent instance
null if not found
org.springframework.dao.DataAccessException - in case of Hibernate errorsSession.get(Class, java.io.Serializable)boolean exists(PK id)
id - the id of the entity
T save(T object)
object - the object to save
void remove(PK id)
id - the identifier (primary key) of the object to removevoid remove(T object)
object - the object to removejava.util.List<T> getAllDistinct()
Note that if you use this method, it is imperative that your model classes correctly implement the hashcode/equals methods
java.util.List<T> findByNamedQuery(java.lang.String queryName,
java.util.Map<java.lang.String,java.lang.Object> queryParams)
queryName - query name of the named queryqueryParams - a map of the query names and the values
java.util.List<T> searchLike(java.lang.String[] criteria,
java.lang.String[] properties,
RequestOptions requestOptions)
criteria - the search criteriaproperties - the searched propertiesrequestOptions - include sort order and pagination information, could be null
java.util.List<T> searchEquals(java.lang.String[] criteria,
java.lang.String[] properties,
RequestOptions requestOptions)
criteria - the search criteriaproperties - the searched propertiesrequestOptions - include sort order and pagination information, could be null
java.util.List<T> search(java.lang.String query)
List of entity managed by the Full Text Search Engine
(Compass etc.). Only the search engine managed attributes of these
entities are populated
query - a Lucene String query
List of entity managed by the Full Text Search Engine.java.util.List<T> searchORMResult(java.lang.String query)
List of entity managed by the ORM engine (Hibernate,
iBatis etc.). All ORM managed attributes of these entities are populated.
query - a Lucene String query
List of entity managed by the ORM engine.
java.util.List<T> searchORMResult(java.lang.String query,
RequestOptions requestOptions)
List of entity managed by the ORM engine (Hibernate,
iBatis etc.), sorted and paginated according to the given request
options. All ORM managed attributes of these entities are populated.
query - a Lucene String queryrequestOptions - include sort order and pagination information, could be null
List of entity managed by the ORM engine.
java.util.List<T> searchORMResult(java.lang.String[] criteria,
java.lang.String[] searchedProperties)
throws DAOLayerException
List of entity managed by the ORM engine
(Hibernate, iBatis etc.). All ORM managed attributes of these entities
are populated.
criteria - the search criteriaproperties - the searched properties
List of entity managed by the ORM engine.
DAOLayerException
java.util.List<T> searchORMResult(java.lang.String[] criteria,
java.lang.String[] searchedProperties,
RequestOptions requestOptions)
throws DAOLayerException
List of entity managed by the ORM engine
(Hibernate, iBatis etc.), sorted and paginated according to the given
request options. All ORM managed attributes of these entities are
populated.
criteria - the search criteriaproperties - the searched propertiesrequestOptions - include sort order and pagination information, could be null
List of entity managed by the ORM engine.
DAOLayerException - if criteria or searchedProperties are emptyjava.util.List<T> getAll(java.util.List<PK> ids)
List of entities matching given ids
ids - a List of ids
List of entities matching ids, must be non null, could
be empty
java.util.List<T> getAll(java.util.List<PK> ids,
RequestOptions requestOptions)
List of entities matching given ids, sorted and
paginated according to the given request options
ids - a List of idsrequestOptions - include sort order and pagination information, could be null
List of entities matching ids, must be
non null, could be emptyjava.util.List<T> search(com.trg.search.IMutableSearch search)
ISearch object.
ISearchint count(com.trg.search.IMutableSearch search)
ISearch if there were no paging or maxResult limits.
ISearchcom.trg.search.SearchResult<T> searchAndCount(com.trg.search.IMutableSearch search)
SearchResult object that includes the list of
results like search() and the total length like
searchLength.
ISearch
T searchUnique(com.trg.search.IMutableSearch search)
throws org.hibernate.NonUniqueResultException
org.hibernate.NonUniqueResultException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||