public class BusinessObjectDaoJpa extends Object implements BusinessObjectDao
| Constructor and Description |
|---|
BusinessObjectDaoJpa(javax.persistence.EntityManager entityManager,
PersistenceStructureService persistenceStructureService) |
| Modifier and Type | Method and Description |
|---|---|
int |
countMatching(Class clazz,
Map<String,?> fieldValues)
This is the default impl that comes with Kuali - uses OJB.
|
int |
countMatching(Class clazz,
Map<String,?> positiveFieldValues,
Map<String,?> negativeFieldValues)
This is the default impl that comes with Kuali - uses OJB.
|
void |
delete(List<? extends PersistableBusinessObject> boList)
Deletes each business object in the given List from the database.
|
void |
delete(PersistableBusinessObject bo)
Deletes the business object passed in.
|
void |
deleteMatching(Class clazz,
Map<String,?> fieldValues)
Deletes the business objects matching the given fieldValues
|
<T extends BusinessObject> |
findAll(Class<T> clazz)
Retrieves all of the records for a given class name.
|
<T extends BusinessObject> |
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> |
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> |
findAllInactive(Class<T> clazz) |
<T extends BusinessObject> |
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> |
findByPrimaryKey(Class<T> clazz,
Map<String,?> primaryKeys)
Retrieves an object instance identified bys it primary keys and values.
|
<T extends BusinessObject> |
findByPrimaryKeyUsingKeyObject(Class<T> clazz,
Object pkObject)
Retrieves an object, based on its PK object
|
<T extends BusinessObject> |
findBySinglePrimaryKey(Class<T> clazz,
Object primaryKey)
Retrieves an object instance identified by its primary key.
|
<T extends BusinessObject> |
findMatching(Class<T> clazz,
Map<String,?> fieldValues)
This is the default impl that comes with Kuali - uses OJB.
|
<T extends BusinessObject> |
findMatching(Criteria criteria)
Uses the passed query to form a Rice QueryByCriteria, which then translates to a JPA query and retrieves results
|
<T extends BusinessObject> |
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> |
findMatchingOrderBy(Class<T> clazz,
Map<String,?> fieldValues,
String sortField,
boolean sortAscending)
This is the default impl that comes with Kuali - uses OJB.
|
javax.persistence.EntityManager |
getEntityManager() |
protected PersistenceStructureService |
getPersistenceStructureService()
Gets the persistenceStructureService attribute.
|
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
|
protected PersistableBusinessObject |
materialize(PersistableBusinessObject bo)
If the object is a proxy, materializes it
|
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 business object.
|
PersistableBusinessObject |
save(PersistableBusinessObject bo)
Saves a business object.
|
void |
setEntityManager(javax.persistence.EntityManager entityManager) |
void |
setPersistenceStructureService(PersistenceStructureService persistenceStructureService)
Sets the persistenceStructureService attribute value.
|
public BusinessObjectDaoJpa(javax.persistence.EntityManager entityManager, PersistenceStructureService persistenceStructureService)
public <T extends BusinessObject> T findBySinglePrimaryKey(Class<T> clazz, Object primaryKey)
BusinessObjectDaoBusinessObjectDao.findByPrimaryKey(Class, Map)findBySinglePrimaryKey in interface BusinessObjectDaoBusinessObjectDao.findBySinglePrimaryKey(java.lang.Class, java.lang.Object)public <T extends BusinessObject> T findByPrimaryKey(Class<T> clazz, Map<String,?> primaryKeys)
BusinessObjectDaofindByPrimaryKey in interface BusinessObjectDaoBusinessObjectDao.findByPrimaryKey(java.lang.Class,
java.util.Map)public <T extends BusinessObject> T findByPrimaryKeyUsingKeyObject(Class<T> clazz, Object pkObject)
findByPrimaryKeyUsingKeyObject in interface BusinessObjectDaoclazz - the class of the object to retrievepkObject - the value of the primary keypublic <T extends BusinessObject> Collection<T> findAll(Class<T> clazz)
findAll in interface BusinessObjectDaoclazz - -
the name of the object being used, either KualiCodeBase or a
subclassBusinessObjectDao.findAll(java.lang.Class)public <T extends BusinessObject> Collection<T> findAllOrderBy(Class<T> clazz, String sortField, boolean sortAscending)
BusinessObjectDaofindAllOrderBy in interface BusinessObjectDaoBusinessObjectDao.findAllOrderBy(java.lang.Class,
java.lang.String, boolean)public <T extends BusinessObject> Collection<T> findMatching(Class<T> clazz, Map<String,?> fieldValues)
findMatching in interface BusinessObjectDaoBusinessObjectDao.findMatching(java.lang.Class,
java.util.Map)public <T extends BusinessObject> Collection<T> findMatching(Criteria criteria)
org.kuali.rice.krad.dao.BusinessObjectDao#findMatching(org.kuali.rice.core.framework.persistence.jpa.criteria.Criteria)public <T extends BusinessObject> Collection<T> findAllActive(Class<T> clazz)
BusinessObjectDaofindAllActive in interface BusinessObjectDaoBusinessObjectDao.findAllActive(java.lang.Class)public <T extends BusinessObject> Collection<T> findAllInactive(Class<T> clazz)
findAllInactive in interface BusinessObjectDaoBusinessObjectDao.findAllActive(java.lang.Class)public <T extends BusinessObject> Collection<T> findAllActiveOrderBy(Class<T> clazz, String sortField, boolean sortAscending)
BusinessObjectDaofindAllActiveOrderBy in interface BusinessObjectDaoBusinessObjectDao.findAllActiveOrderBy(java.lang.Class,
java.lang.String, boolean)public <T extends BusinessObject> Collection<T> findMatchingActive(Class<T> clazz, Map<String,?> fieldValues)
BusinessObjectDaofindMatchingActive in interface BusinessObjectDaoBusinessObjectDao.findMatchingActive(java.lang.Class,
java.util.Map)public int countMatching(Class clazz, Map<String,?> fieldValues)
countMatching in interface BusinessObjectDaoBusinessObjectDao.countMatching(java.lang.Class,
java.util.Map)public int countMatching(Class clazz, Map<String,?> positiveFieldValues, Map<String,?> negativeFieldValues)
countMatching in interface BusinessObjectDaopositiveFieldValues - Map of fields and values for positive criterianegativeFieldValues - Map of fields and values for negative criteriaBusinessObjectDao.countMatching(java.lang.Class,
java.util.Map, java.util.Map)public <T extends BusinessObject> Collection<T> findMatchingOrderBy(Class<T> clazz, Map<String,?> fieldValues, String sortField, boolean sortAscending)
findMatchingOrderBy in interface BusinessObjectDaoBusinessObjectDao.findMatching(java.lang.Class,
java.util.Map)public PersistableBusinessObject save(PersistableBusinessObject bo) throws org.springframework.dao.DataAccessException
save in interface BusinessObjectDaoorg.springframework.dao.DataAccessExceptionBusinessObjectDao.save(org.kuali.rice.krad.bo.PersistableBusinessObject)public List<? extends PersistableBusinessObject> save(List businessObjects) throws org.springframework.dao.DataAccessException
save in interface BusinessObjectDaoorg.springframework.dao.DataAccessExceptionBusinessObjectDao.save(org.kuali.rice.krad.bo.PersistableBusinessObject)public void delete(PersistableBusinessObject bo)
delete in interface BusinessObjectDaobo - org.springframework.dao.DataAccessExceptionBusinessObjectDao.delete(org.kuali.rice.krad.bo.PersistableBusinessObject)protected PersistableBusinessObject materialize(PersistableBusinessObject bo)
bo - the business object, which may be a sneaky proxypublic void delete(List<? extends PersistableBusinessObject> boList)
BusinessObjectDaodelete in interface BusinessObjectDaoBusinessObjectDao.delete(java.util.List)public void deleteMatching(Class clazz, Map<String,?> fieldValues)
BusinessObjectDaodeleteMatching in interface BusinessObjectDaoBusinessObjectDao.deleteMatching(java.lang.Class,
java.util.Map)public PersistableBusinessObject retrieve(PersistableBusinessObject object)
BusinessObjectDaoretrieve in interface BusinessObjectDaoBusinessObjectDao.retrieve(org.kuali.rice.krad.bo.PersistableBusinessObject)public PersistableBusinessObject manageReadOnly(PersistableBusinessObject bo)
BusinessObjectDaomanageReadOnly in interface BusinessObjectDaobo - the business object to managedBusinessObjectDao.manageReadOnly(org.kuali.rice.krad.bo.PersistableBusinessObject)protected PersistenceStructureService getPersistenceStructureService()
public void setPersistenceStructureService(PersistenceStructureService persistenceStructureService)
persistenceStructureService - The persistenceStructureService to set.public javax.persistence.EntityManager getEntityManager()
public void setEntityManager(javax.persistence.EntityManager entityManager)
entityManager - the entityManager to setCopyright © 2005–2016 The Kuali Foundation. All rights reserved.