|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface GenericDao
This is the generic data access interface for business objects. This class was adapted from the Kuali Nervous System (org.kuali.rice.kns.dao.BusinessObjectDao). It's not as generic as it could be as it relies on the OJB criteria object...
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<Object> boList)
Deletes each business object in the given List from the database. |
void |
delete(Object 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 |
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. |
Object |
findById(Class clazz,
Object keyValue)
Retrieves an object instance identified bys it primary key. |
Object |
findByPrimaryKey(Class clazz,
Map primaryKeys)
Retrieves an object instance identified by its primary keys and values. |
Object |
findByUniqueKey(Class clazz,
Map uniqueKeys)
This method should be used to try and locate an object instance by passing in unique keys and values. |
Collection |
findMatching(Class clazz,
org.apache.ojb.broker.query.Criteria criteria)
This method allows for a more flexible search by allowing the programmer to construct the criteria however they need to and then pass that in for execution. |
Collection |
findMatching(Class clazz,
org.apache.ojb.broker.query.Criteria criteria,
boolean selectForUpdate,
long wait)
This method allows for a more flexible search by allowing the programmer to construct the criteria however they need to and then pass that in for execution. |
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 |
findMatchingByExample(Object object)
This method allows you to pass in an object that has some fields filled in, and will query underneath by automatically constructing a select statement whose where clause is built automatically by looking at the non-null attributes and using their values as part of the query. |
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. |
Object |
retrieve(Object 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 objects |
void |
save(Object bo)
Saves any object |
Method Detail |
---|
void save(Object bo)
bo
- void save(List businessObjects)
businessObjects
- Object findById(Class clazz, Object keyValue)
clazz
- the classid
- the primary key value
Object findByPrimaryKey(Class clazz, Map primaryKeys)
clazz
- primaryKeys
-
Object findByUniqueKey(Class clazz, Map uniqueKeys)
clazz
- uniqueKeys
-
Object retrieve(Object object)
object
-
Collection findMatchingByExample(Object object)
object
-
Collection findAll(Class clazz)
clazz
-
Collection findAllOrderBy(Class clazz, String sortField, boolean sortAscending)
clazz
-
Collection findMatching(Class clazz, Map fieldValues)
clazz
- fieldValues
-
Collection findMatching(Class clazz, org.apache.ojb.broker.query.Criteria criteria)
clazz
- criteria
-
Collection findMatching(Class clazz, org.apache.ojb.broker.query.Criteria criteria, boolean selectForUpdate, long wait)
clazz
- criteria
- selectForUpdate
- whether to perform a select for update querywait
- millis to wait for select for update
int countMatching(Class clazz, Map fieldValues)
clazz
- fieldValues
-
int countMatching(Class clazz, Map positiveFieldValues, Map negativeFieldValues)
clazz
- positiveFieldValues
- Map of fields and values for positive criterianegativeFieldValues
- Map of fields and values for negative criteria
Collection findMatchingOrderBy(Class clazz, Map fieldValues, String sortField, boolean sortAscending)
clazz
- fieldValues
-
void delete(Object bo)
bo
- void delete(List<Object> boList)
boList
- void deleteMatching(Class clazz, Map fieldValues)
clazz
- fieldValues
-
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |