org.kuali.rice.kns.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 fieldValues)
           
 int countMatching(Class clazz, Map positiveFieldValues, Map 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 fieldValues)
          Deletes the business objects matching the given fieldValues
 Collection findAll(Class clazz)
          Retrieves a collection of business objects populated with data, such that each record in the database populates a new object instance.
 Collection findAllActive(Class clazz)
          Retrieves a collection of business objects populated with data, such that each record in the database populates a new object instance.
 Collection findAllActiveOrderBy(Class 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.
 Collection findAllInactive(Class clazz)
           
 Collection findAllOrderBy(Class 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.
 PersistableBusinessObject findByPrimaryKey(Class clazz, Map primaryKeys)
          Retrieves an object instance identified bys it primary keys and values.
 PersistableBusinessObject findBySinglePrimaryKey(Class clazz, Object primaryKey)
          Retrieves an object instance identified by its primary key.
 Collection findMatching(Class clazz, Map fieldValues)
          This method retrieves a collection of business objects populated with data, such that each record in the database populates a new object instance.
 Collection findMatchingActive(Class clazz, Map fieldValues)
          This method retrieves a collection of business objects populated with data, such that each record in the database populates a new object instance.
 Collection findMatchingOrderBy(Class clazz, Map 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 retrieve(PersistableBusinessObject object)
          Retrieves an object instance identified by the class of the given object and the object's primary key values.
 void save(List businessObjects)
          Saves a List of BusinessObjects.
 void save(PersistableBusinessObject bo)
          Saves any object that implements the BusinessObject interface.
 

Method Detail

save

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

Parameters:
bo -

save

void save(List businessObjects)
Saves a List of BusinessObjects.

Parameters:
businessObjects -

findBySinglePrimaryKey

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

Parameters:
clazz -
primaryKey -
Returns:

findByPrimaryKey

PersistableBusinessObject findByPrimaryKey(Class clazz,
                                           Map 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:

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

Collection findAll(Class 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

Collection findAllActive(Class 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

Collection findAllInactive(Class clazz)

findAllOrderBy

Collection findAllOrderBy(Class 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

Collection findAllActiveOrderBy(Class 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

Collection findMatching(Class clazz,
                        Map 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

Collection findMatchingActive(Class clazz,
                              Map 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 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 positiveFieldValues,
                  Map 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

Collection findMatchingOrderBy(Class clazz,
                               Map 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 fieldValues)
Deletes the business objects matching the given fieldValues

Parameters:
clazz -
fieldValues -


Copyright © 2007-2011 The Kuali Foundation. All Rights Reserved.