org.ow2.dragon.persistence.dao
Interface UniversalORMDAO

All Known Implementing Classes:
UniversalHibernateDAOImpl

public interface UniversalORMDAO

Data Access Object (DAO) interface. The only real difference between this DAO and GenericORMDAO is that instances of java.lang.Class are passed into the methods in this class, and they are part of the constructor in the GenericDao, hence you'll have to do some casting if you use this one.

See Also:
org.appfuse.dao.GenericDao

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 requestOptionsTO)
          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 object)
           
 java.lang.Object persist(java.lang.Object object)
           
 void remove(java.lang.Class clazz, java.io.Serializable id)
          Generic method to delete an object based on class and id
 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 object)
           
 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 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.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 object)
           
 

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.

Parameters:
clazz - model class to lookup
id - the identifier (primary key) of the class
Returns:
a populated object or null if not found

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

exists

boolean exists(java.lang.Class clazz,
               java.io.Serializable id)
Checks for existence of an object of type T using the id arg.

Parameters:
id - the id of the entity
Returns:
- true if it exists, false if it doesn't

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

removeAll

void removeAll(java.lang.Class clazz,
               java.util.List ids)
Generic method to delete all object based on class and ids list

Parameters:
clazz - model class to lookup
ids - the identifiers (primary key) of object to delete

removeAll

void removeAll(java.util.List objects)

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 requestOptionsTO)
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
requestOptionsTO - 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.

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

search

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.

See Also:
ISearch

count

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.

See Also:
ISearch

searchAndCount

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.

See Also:
ISearch

searchUnique

java.lang.Object searchUnique(java.lang.Class clazz,
                              com.trg.search.IMutableSearch search)
                              throws org.hibernate.NonUniqueResultException
Search for a single result using the given parameters.

Throws:
org.hibernate.NonUniqueResultException

findByNamedQuery

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

Parameters:
queryName - query name of the named query
queryParams - a map of the query names and the values
Returns:
a list of the records found

merge

java.lang.Object merge(java.lang.Object object)

persist

java.lang.Object persist(java.lang.Object object)

saveOnly

java.lang.Object saveOnly(java.lang.Object object)

updateOnly

java.lang.Object updateOnly(java.lang.Object object)


Copyright © 2008-2009 eBMWebsourcing. All Rights Reserved.