org.ow2.dragon.persistence.dao
Interface UniversalUnifiedDAO

All Known Implementing Classes:
UniversalCompassHibernateDAOImpl

public interface UniversalUnifiedDAO

Author:
ofabre - eBM Websourcing

Method Summary
 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.
 void remove(java.lang.Class clazz, java.io.Serializable id)
          Generic method to delete an object based on class and id
 java.lang.Object save(java.lang.Object o)
          Generic method to save an object - handles both update and insert.
 java.util.List search(java.lang.String query, java.lang.Class clazz)
          Return a List of entity managed by the Full Text Search Engine (Compass etc.).
 java.util.List searchEquals(java.lang.Class clazz, 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 searchLike(java.lang.Class clazz, 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<? extends BaseObject> searchORMResult(java.lang.String[] criteria, java.lang.String[] searchedProperties, java.lang.Class<? extends BaseObject> clazz)
          This method allows to search Objects on String properties, fitting search criteria.
 java.util.List<? extends BaseObject> searchORMResult(java.lang.String[] criteria, java.lang.String[] searchedProperties, java.lang.Class<? extends BaseObject> clazz, RequestOptions requestOptions)
          This method allows to search Objects on String properties, fitting search criteria.
 java.util.List<? extends BaseObject> searchORMResult(java.lang.String query, java.lang.Class<? extends BaseObject> clazz)
          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<? extends BaseObject> searchORMResult(java.lang.String query, java.lang.Class<? extends BaseObject> clazz, 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.
 

Method Detail

getAll

java.util.List getAll(java.lang.Class clazz)
Generic method used to get all objects of a particular type. This is the same as lookup up all rows in a table.

Parameters:
clazz - the type of objects (a.k.a. while table) to get data from
Returns:
List of populated objects

get

java.lang.Object get(java.lang.Class clazz,
                     java.io.Serializable id)
Generic method to get an object based on class and identifier. An ObjectRetrievalFailureException Runtime Exception is thrown if nothing is found.

Parameters:
clazz - model class to lookup
id - the identifier (primary key) of the class
Returns:
a populated object
See Also:
ObjectRetrievalFailureException

save

java.lang.Object save(java.lang.Object o)
Generic method to save an object - handles both update and insert.

Parameters:
o - the object to save
Returns:
a populated object

remove

void remove(java.lang.Class clazz,
            java.io.Serializable id)
Generic method to delete an object based on class and id

Parameters:
clazz - model class to lookup
id - the identifier (primary key) of the class

search

java.util.List search(java.lang.String query,
                      java.lang.Class clazz)
Return a List of entity managed by the Full Text Search Engine (Compass etc.). Only the search engine managed attributes of these entities are populated

Parameters:
query - a Lucene String query
clazz - model class to lookup
Returns:
a List of entity managed by the Full Text Search Engine.

searchORMResult

java.util.List<? extends BaseObject> searchORMResult(java.lang.String query,
                                                     java.lang.Class<? extends BaseObject> clazz)
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.). All ORM managed attributes of these entities are populated.

Parameters:
query - a Lucene String query
clazz - model class to lookup
Returns:
a List of entity managed by the ORM engine.

searchORMResult

java.util.List<? extends BaseObject> searchORMResult(java.lang.String[] criteria,
                                                     java.lang.String[] searchedProperties,
                                                     java.lang.Class<? extends BaseObject> clazz)
This method allows to search Objects on String properties, fitting search criteria. Properties can be direct object fields or fields of included objects (in this case, fields must be referenced by the doted notation like "foo.bar"). 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.). All ORM managed attributes of these entities are populated.

Parameters:
criteria - the search criteria
properties - the searched properties
clazz - model class to lookup
Returns:
a List of entity managed by the ORM engine.

searchORMResult

java.util.List<? extends BaseObject> searchORMResult(java.lang.String[] criteria,
                                                     java.lang.String[] searchedProperties,
                                                     java.lang.Class<? extends BaseObject> clazz,
                                                     RequestOptions requestOptions)
This method allows to search Objects on String properties, fitting search criteria. Properties can be direct object fields or fields of included objects (in this case, fields must be referenced by the doted notation like "foo.bar"). 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. All ORM managed attributes of these entities are populated.

Parameters:
criteria - the search criteria
properties - the searched properties
clazz - model class to lookup
requestOptions - include sort order and pagination information
Returns:
a List of entity managed by the ORM engine.

searchORMResult

java.util.List<? extends BaseObject> searchORMResult(java.lang.String query,
                                                     java.lang.Class<? extends BaseObject> clazz,
                                                     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. All ORM managed attributes of these entities are populated.

Parameters:
query - a Lucene String query
clazz - model class to lookup
requestOptions - include sort order and pagination information
Returns:
a List of entity managed by the ORM engine.

getAll

java.util.List getAll(java.lang.Class clazz,
                      java.util.List ids)
Retrieve a List of entities matching given ids

Parameters:
clazz - model class to lookup
ids - a List of ids
Returns:
a List of entities matching ids, must be non null, could be empty

getAll

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

Parameters:
clazz - model class to lookup
ids - a List of ids
requestOptions - include sort order and pagination information
Returns:
a sorted/paginated List of entities matching ids, must be non null, could be empty

getAll

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. This is the same as lookup up all rows in a table.

Parameters:
clazz - model class to lookup
requestOptions - include sort order and pagination information
Returns:
List of populated objects

searchLike

java.util.List searchLike(java.lang.Class clazz,
                          java.lang.String[] criteria,
                          java.lang.String[] properties,
                          RequestOptions requestOptionsTO)
This method allows to search Objects on String properties, fitting search criteria. Properties can be direct object fields or fields of included objects (in this case, fields must be referenced by the doted notation like "foo.bar"). Use a like statement for each criteria on each property. Results are sorted and paginated in respect of the given request options.
Limitations: this method can have some troubles if two or more doted properties contains the same field like "aaa.bbb" and "ccc.ddd. bbb"

Parameters:
clazz - model class to lookup
criteria - the search criteria
properties - the searched properties
requestOptionsTO - include sort order and pagination information
Returns:
a list of object matching the different criteria sorted and paginated

searchEquals

java.util.List searchEquals(java.lang.Class clazz,
                            java.lang.String[] criteria,
                            java.lang.String[] properties,
                            RequestOptions requestOptionsTO)
This method allows to search Objects on String properties, fitting search criteria. Properties can be direct object fields or fields of included objects (in this case, fields must be referenced by the doted notation like "foo.bar"). Use a equality statement for each criteria on each property. Results are sorted and paginated in respect of the given request options.

Parameters:
clazz - model class to lookup
criteria - the search criteria
properties - the searched properties
requestOptionsTO - include sort order and pagination information
Returns:
a list of object matching the different criteria sorted and paginated


Copyright © 2008 eBMWebsourcing. All Rights Reserved.