org.kuali.rice.krad.dao
Interface BusinessObjectDao

All Known Implementing Classes:
BusinessObjectDaoJpa, BusinessObjectDaoOjb, BusinessObjectDaoProxy

public interface BusinessObjectDao

This is the generic data access interface for business objects. This should be used for unit testing purposes only.


Method Summary
 int countMatching(Class clazz, Map<String,?> fieldValues)
           
 int countMatching(Class clazz, Map<String,?> positiveFieldValues, Map<String,?> negativeFieldValues)
          This method returns the number of matching result given the positive criterias and negative criterias.
 void delete(List<? extends PersistableBusinessObject> boList)
          Deletes each business object in the given List from the database.
 void delete(PersistableBusinessObject bo)
          Deletes a business object from the database.
 void deleteMatching(Class clazz, Map<String,?> fieldValues)
          Deletes the business objects matching the given fieldValues
<T extends BusinessObject>
Collection<T>
findAll(Class<T> clazz)
          Retrieves a collection of business objects populated with data, such that each record in the database populates a new object instance.
<T extends BusinessObject>
Collection<T>
findAllActive(Class<T> clazz)
          Retrieves a collection of business objects populated with data, such that each record in the database populates a new object instance.
<T extends BusinessObject>
Collection<T>
findAllActiveOrderBy(Class<T> clazz, String sortField, boolean sortAscending)
          Retrieves a collection of business objects populated with data, such that each record in the database populates a new object instance.
<T extends BusinessObject>
Collection<T>
findAllInactive(Class<T> clazz)
           
<T extends BusinessObject>
Collection<T>
findAllOrderBy(Class<T> clazz, String sortField, boolean sortAscending)
          Retrieves a collection of business objects populated with data, such that each record in the database populates a new object instance.
<T extends BusinessObject>
T
findByPrimaryKey(Class<T> clazz, Map<String,?> primaryKeys)
          Retrieves an object instance identified bys it primary keys and values.
<T extends BusinessObject>
T
findByPrimaryKeyUsingKeyObject(Class<T> clazz, Object pkObject)
          Retrieves an object, based on its PK object
<T extends BusinessObject>
T
findBySinglePrimaryKey(Class<T> clazz, Object primaryKey)
          Retrieves an object instance identified by its primary key.
<T extends BusinessObject>
Collection<T>
findMatching(Class<T> clazz, Map<String,?> fieldValues)
          This method retrieves a collection of business objects populated with data, such that each record in the database populates a new object instance.
<T extends BusinessObject>
Collection<T>
findMatchingActive(Class<T> clazz, Map<String,?> fieldValues)
          This method retrieves a collection of business objects populated with data, such that each record in the database populates a new object instance.
<T extends BusinessObject>
Collection<T>
findMatchingOrderBy(Class<T> clazz, Map<String,?> fieldValues, String sortField, boolean sortAscending)
          This method retrieves a collection of business objects populated with data, such that each record in the database populates a new object instance.
 PersistableBusinessObject manageReadOnly(PersistableBusinessObject bo)
          Merges the given business object, but tells the ORM that the object is to be treated as Read Only, and even if it has changes, it will not be persisted to the database
 PersistableBusinessObject retrieve(PersistableBusinessObject object)
          Retrieves an object instance identified by the class of the given object and the object's primary key values.
 List<? extends PersistableBusinessObject> save(List businessObjects)
          Saves a List of BusinessObjects.
 PersistableBusinessObject save(PersistableBusinessObject bo)
          Saves any object that implements the BusinessObject interface.
 

Method Detail

save

PersistableBusinessObject save(PersistableBusinessObject bo)
Saves any object that implements the BusinessObject interface.

Parameters:
bo -

save

List<? extends PersistableBusinessObject> save(List businessObjects)
Saves a List of BusinessObjects.

Parameters:
businessObjects -

findBySinglePrimaryKey

<T extends BusinessObject> T findBySinglePrimaryKey(Class<T> clazz,
                                                    Object primaryKey)
Retrieves an object instance identified by its primary key. For composite keys, use findByPrimaryKey(Class, Map)

Parameters:
clazz -
primaryKey -
Returns:

findByPrimaryKey

<T extends BusinessObject> T findByPrimaryKey(Class<T> clazz,
                                              Map<String,?> primaryKeys)
Retrieves an object instance identified bys it primary keys and values. This can be done by constructing a map where the key to the map entry is the primary key attribute and the value of the entry being the primary key value. For composite keys, pass in each primaryKey attribute and its value as a map entry.

Parameters:
clazz -
primaryKeys -
Returns:

findByPrimaryKeyUsingKeyObject

<T extends BusinessObject> T findByPrimaryKeyUsingKeyObject(Class<T> clazz,
                                                            Object pkObject)
Retrieves an object, based on its PK object

Parameters:
clazz - the class of the object to retrieve
pkObject - the value of the primary key
Returns:
the retrieved PersistableBusinessObject

retrieve

PersistableBusinessObject retrieve(PersistableBusinessObject object)
Retrieves an object instance identified by the class of the given object and the object's primary key values.

Parameters:
object -
Returns:

findAll

<T extends BusinessObject> Collection<T> findAll(Class<T> clazz)
Retrieves a collection of business objects populated with data, such that each record in the database populates a new object instance. This will only retrieve business objects by class type.

Parameters:
clazz -
Returns:

findAllActive

<T extends BusinessObject> Collection<T> findAllActive(Class<T> clazz)
Retrieves a collection of business objects populated with data, such that each record in the database populates a new object instance. This will only retrieve business objects by class type. Adds criteria on active column to return only active records. Assumes there exist a mapping for PropertyConstants.Active

Parameters:
clazz -
Returns:

findAllInactive

<T extends BusinessObject> Collection<T> findAllInactive(Class<T> clazz)

findAllOrderBy

<T extends BusinessObject> Collection<T> findAllOrderBy(Class<T> clazz,
                                                        String sortField,
                                                        boolean sortAscending)
Retrieves a collection of business objects populated with data, such that each record in the database populates a new object instance. This will only retrieve business objects by class type. Orders the results by the given field.

Parameters:
clazz -
Returns:

findAllActiveOrderBy

<T extends BusinessObject> Collection<T> findAllActiveOrderBy(Class<T> clazz,
                                                              String sortField,
                                                              boolean sortAscending)
Retrieves a collection of business objects populated with data, such that each record in the database populates a new object instance. This will only retrieve business objects by class type. Orders the results by the given field. Adds criteria on active column to return only active records. Assumes there exist a mapping for PropertyConstants.Active

Parameters:
clazz -
Returns:

findMatching

<T extends BusinessObject> Collection<T> findMatching(Class<T> clazz,
                                                      Map<String,?> fieldValues)
This method retrieves a collection of business objects populated with data, such that each record in the database populates a new object instance. This will retrieve business objects by class type and also by criteria passed in as key-value pairs, specifically attribute name-expected value.

Parameters:
clazz -
fieldValues -
Returns:

findMatchingActive

<T extends BusinessObject> Collection<T> findMatchingActive(Class<T> clazz,
                                                            Map<String,?> fieldValues)
This method retrieves a collection of business objects populated with data, such that each record in the database populates a new object instance. This will retrieve business objects by class type and also by criteria passed in as key-value pairs, specifically attribute name-expected value. Adds criteria on active column to return only active records. Assumes there exist a mapping for PropertyConstants.Active

Parameters:
clazz -
fieldValues -
Returns:

countMatching

int countMatching(Class clazz,
                  Map<String,?> fieldValues)
Parameters:
clazz -
fieldValues -
Returns:
count of BusinessObjects of the given class whose fields match the values in the given Map.

countMatching

int countMatching(Class clazz,
                  Map<String,?> positiveFieldValues,
                  Map<String,?> negativeFieldValues)
This method returns the number of matching result given the positive criterias and negative criterias. The negative criterias are the ones that will be set to "notEqualTo" or "notIn"

Parameters:
clazz -
positiveFieldValues - Map of fields and values for positive criteria
negativeFieldValues - Map of fields and values for negative criteria
Returns:

findMatchingOrderBy

<T extends BusinessObject> Collection<T> findMatchingOrderBy(Class<T> clazz,
                                                             Map<String,?> fieldValues,
                                                             String sortField,
                                                             boolean sortAscending)
This method retrieves a collection of business objects populated with data, such that each record in the database populates a new object instance. This will retrieve business objects by class type and also by criteria passed in as key-value pairs, specifically attribute name-expected value. Orders the results by the given field.

Parameters:
clazz -
fieldValues -
Returns:

delete

void delete(PersistableBusinessObject bo)
Deletes a business object from the database.

Parameters:
bo -

delete

void delete(List<? extends PersistableBusinessObject> boList)
Deletes each business object in the given List from the database.

Parameters:
boList -

deleteMatching

void deleteMatching(Class clazz,
                    Map<String,?> fieldValues)
Deletes the business objects matching the given fieldValues

Parameters:
clazz -
fieldValues -

manageReadOnly

PersistableBusinessObject manageReadOnly(PersistableBusinessObject bo)
Merges the given business object, but tells the ORM that the object is to be treated as Read Only, and even if it has changes, it will not be persisted to the database

Parameters:
bo - the business object to managed
Returns:
the managed copied of the business object


Copyright © 2005-2013 The Kuali Foundation. All Rights Reserved.