|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
T - a type variablePK - the primary key for that typepublic interface GenericORMDAO<T,PK extends java.io.Serializable>
Generic DAO (Data Access Object) with common methods to CRUD POJOs.
Extend this interface if you want typesafe (no casting necessary) DAO's for your domain objects.
| Method Summary | |
|---|---|
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)
Generic method to get an object based on class and identifier. |
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 requestOptionsTO)
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. |
java.lang.Class<T> |
getManipulatedType()
Return the type of entity manipulated by this DAO |
void |
remove(PK id)
Generic method to delete an object based on class and id |
T |
save(T object)
Generic method to save an object - handles both update and insert. |
java.util.List<T> |
searchEquals(java.lang.String[] criteria,
java.lang.String[] properties,
RequestOptions requestOptionsTO)
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 requestOptionsTO)
This method allows to search Objects on String properties, fitting search criteria. |
| Method Detail |
|---|
java.util.List<T> getAll(RequestOptions requestOptionsTO)
requestOptionsTO - include sort order and pagination information
java.util.List<T> getAll()
T get(PK id)
id - the identifier (primary key) of the object to get
ObjectRetrievalFailureExceptionboolean 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 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 requestOptionsTO)
criteria - the search criteriaproperties - the searched propertiesrequestOptionsTO - include sort order and pagination information
java.util.List<T> searchEquals(java.lang.String[] criteria,
java.lang.String[] properties,
RequestOptions requestOptionsTO)
criteria - the search criteriaproperties - the searched propertiesrequestOptionsTO - include sort order and pagination information
java.lang.Class<T> getManipulatedType()
Class of the manipulated entityjava.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
List of entities matching ids, must be
non null, could be empty
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||