public class BusinessObjectServiceImpl extends Object implements BusinessObjectService
Constructor and Description |
---|
BusinessObjectServiceImpl() |
Modifier and Type | Method and Description |
---|---|
int |
countMatching(Class clazz,
Map<String,?> fieldValues)
This method retrieves a count of the business objects populated with data which match the criteria in the given Map.
|
int |
countMatching(Class clazz,
Map<String,?> positiveFieldValues,
Map<String,?> negativeFieldValues)
This method retrieves a count of the business objects populated with data which match both the positive criteria
and the negative criteria in the given Map.
|
void |
delete(List<? extends PersistableBusinessObject> boList)
Deletes each business object in the given List.
|
void |
delete(PersistableBusinessObject bo)
Deletes a business object from the database.
|
void |
deleteMatching(Class clazz,
Map<String,?> fieldValues)
Deletes the object(s) matching the given field values
|
<T extends BusinessObject> |
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> |
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 by its primary keys and values.
|
<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 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 method retrieves a collection of business objects populated with data, such that each record in the database populates a
new object instance.
|
protected BusinessObjectDao |
getBusinessObjectDao()
Gets the businessObjectDao attribute.
|
protected DataObjectMetaDataService |
getDataObjectMetaDataService() |
protected PersonService |
getPersonService() |
BusinessObject |
getReferenceIfExists(BusinessObject bo,
String referenceName)
This method attempts to retrieve the reference from a BO if it exists.
|
protected boolean |
isBusinessObjectAllowedForSave(PersistableBusinessObject bo)
Returns true if the BusinessObjectService should be permitted to save instances of the given PersistableBusinessObject.
|
List<? extends PersistableBusinessObject> |
linkAndSave(List<? extends PersistableBusinessObject> businessObjects)
Links up any contained objects, and Saves the businessObjects on the list via the persistence layer.
|
PersistableBusinessObject |
linkAndSave(PersistableBusinessObject bo)
Links up any contained objects, and then Saves the passed in object via the persistence layer.
|
void |
linkUserFields(List<PersistableBusinessObject> bos)
Updates all KualiUser or Person objects contained within this BO, based on the UserID as the authoritative key.
|
void |
linkUserFields(PersistableBusinessObject bo)
Updates all KualiUser or Person objects contained within this BO, based on the UserID as the authoritative key.
|
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<? extends PersistableBusinessObject> businessObjects)
Saves the businessObjects on the list via the persistence layer.
|
<T extends PersistableBusinessObject> |
save(T bo)
Saves the passed in object via the persistence layer.
|
void |
setBusinessObjectDao(BusinessObjectDao businessObjectDao)
Sets the businessObjectDao attribute value.
|
void |
setDataObjectMetaDataService(DataObjectMetaDataService dataObjectMetadataService) |
void |
setPersistenceService(PersistenceService persistenceService)
Sets the persistenceService attribute value.
|
void |
setPersistenceStructureService(PersistenceStructureService persistenceStructureService)
Sets the persistenceStructureService attribute value.
|
void |
setPersonService(PersonService personService)
Sets the kualiUserService attribute value.
|
protected void |
validateBusinessObjectForSave(List<? extends PersistableBusinessObject> businessObjects) |
protected void |
validateBusinessObjectForSave(PersistableBusinessObject bo) |
public BusinessObjectServiceImpl()
@Transactional public <T extends PersistableBusinessObject> T save(T bo)
BusinessObjectService
save
in interface BusinessObjectService
bo
- A BusinessObject instance or descendent that you wish to be stored.@Transactional public List<? extends PersistableBusinessObject> save(List<? extends PersistableBusinessObject> businessObjects)
BusinessObjectService
save
in interface BusinessObjectService
businessObjects
- A List@Transactional public PersistableBusinessObject linkAndSave(PersistableBusinessObject bo)
BusinessObjectService
linkAndSave
in interface BusinessObjectService
bo
- A BusinessObject instance or descendent that you wish to be stored.@Transactional public List<? extends PersistableBusinessObject> linkAndSave(List<? extends PersistableBusinessObject> businessObjects)
BusinessObjectService
linkAndSave
in interface BusinessObjectService
businessObjects
- A Listprotected void validateBusinessObjectForSave(PersistableBusinessObject bo)
protected void validateBusinessObjectForSave(List<? extends PersistableBusinessObject> businessObjects)
protected boolean isBusinessObjectAllowedForSave(PersistableBusinessObject bo)
public <T extends BusinessObject> T findBySinglePrimaryKey(Class<T> clazz, Object primaryKey)
BusinessObjectService
BusinessObjectService.findByPrimaryKey(Class, Map)
findBySinglePrimaryKey
in interface BusinessObjectService
public <T extends BusinessObject> T findByPrimaryKey(Class<T> clazz, Map<String,?> primaryKeys)
BusinessObjectService
findByPrimaryKey
in interface BusinessObjectService
public PersistableBusinessObject retrieve(PersistableBusinessObject object)
BusinessObjectService
retrieve
in interface BusinessObjectService
public <T extends BusinessObject> Collection<T> findAll(Class<T> clazz)
BusinessObjectService
findAll
in interface BusinessObjectService
public <T extends BusinessObject> Collection<T> findAllOrderBy(Class<T> clazz, String sortField, boolean sortAscending)
BusinessObjectService
findAllOrderBy
in interface BusinessObjectService
public <T extends BusinessObject> Collection<T> findMatching(Class<T> clazz, Map<String,?> fieldValues)
BusinessObjectService
findMatching
in interface BusinessObjectService
public int countMatching(Class clazz, Map<String,?> fieldValues)
BusinessObjectService
countMatching
in interface BusinessObjectService
public int countMatching(Class clazz, Map<String,?> positiveFieldValues, Map<String,?> negativeFieldValues)
BusinessObjectService
countMatching
in interface BusinessObjectService
public <T extends BusinessObject> Collection<T> findMatchingOrderBy(Class<T> clazz, Map<String,?> fieldValues, String sortField, boolean sortAscending)
BusinessObjectService
findMatchingOrderBy
in interface BusinessObjectService
@Transactional public void delete(PersistableBusinessObject bo)
BusinessObjectService
delete
in interface BusinessObjectService
@Transactional public void delete(List<? extends PersistableBusinessObject> boList)
BusinessObjectService
delete
in interface BusinessObjectService
@Transactional public void deleteMatching(Class clazz, Map<String,?> fieldValues)
BusinessObjectService
deleteMatching
in interface BusinessObjectService
public BusinessObject getReferenceIfExists(BusinessObject bo, String referenceName)
BusinessObjectService
getReferenceIfExists
in interface BusinessObjectService
bo
- - populated BusinessObject instance that includes the referenceName propertyreferenceName
- - name of the member/property to loadpublic void linkUserFields(PersistableBusinessObject bo)
BusinessObjectService
linkUserFields
in interface BusinessObjectService
bo
- The populated BO (or descendent) instance to be linked & updatedpublic void linkUserFields(List<PersistableBusinessObject> bos)
BusinessObjectService
linkUserFields
in interface BusinessObjectService
bos
- A List of populated BusinessObject (or descendent) instances to be linked & updated.public PersistableBusinessObject manageReadOnly(PersistableBusinessObject bo)
BusinessObjectService
manageReadOnly
in interface BusinessObjectService
bo
- the business object to managedprotected BusinessObjectDao getBusinessObjectDao()
public void setBusinessObjectDao(BusinessObjectDao businessObjectDao)
businessObjectDao
- The businessObjectDao to set.public void setPersistenceStructureService(PersistenceStructureService persistenceStructureService)
persistenceStructureService
- The persistenceStructureService to set.public final void setPersonService(PersonService personService)
protected PersonService getPersonService()
public final void setPersistenceService(PersistenceService persistenceService)
persistenceService
- The persistenceService to set.protected DataObjectMetaDataService getDataObjectMetaDataService()
public void setDataObjectMetaDataService(DataObjectMetaDataService dataObjectMetadataService)
Copyright © 2005–2016 The Kuali Foundation. All rights reserved.