public class DefaultOrgUnitHierarchyService extends java.lang.Object implements OrgUnitHierarchyService
OrgUnitHierarchyService interface.| Modifier and Type | Field and Description |
|---|---|
static char |
DELIMITER
Character used as a delimiter between unit UIDs in the path.
|
| Constructor and Description |
|---|
DefaultOrgUnitHierarchyService() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
beforeUpdate(OrgUnitModel unit,
OrgUnitModel parentUnit) |
protected java.util.Set<OrgUnitModel> |
generatePathForUnit(OrgUnitModel unit,
OrgUnitModel parentUnit) |
<T extends OrgUnitModel> |
generateUnitPaths(java.lang.Class<T> unitType)
Generates the
path value of all OrgUnitModel objects of the given unit type. |
protected java.util.Set<OrgUnitModel> |
getChildrenOfSameType(OrgUnitModel unit) |
protected ModelService |
getModelService() |
protected OrgUnitDao |
getOrgUnitDao() |
protected OrgUnitModel |
getParentUnit(OrgUnitModel unit) |
protected SessionService |
getSessionService() |
protected void |
handleTransactionException(java.lang.Exception e) |
void |
saveChangesAndUpdateUnitPath(OrgUnitModel unit)
Saves all changes to the given
OrgUnitModel and updates its path value as well as the
path values for all its descendants of the same type subsequently. |
void |
setModelService(ModelService modelService) |
void |
setOrgUnitDao(OrgUnitDao orgUnitDao) |
void |
setSessionService(SessionService sessionService) |
protected void |
updateUnitPath(OrgUnitModel unit) |
protected void |
validatePath(OrgUnitModel parentUnit) |
public static final char DELIMITER
public <T extends OrgUnitModel> void generateUnitPaths(java.lang.Class<T> unitType)
path value of all OrgUnitModel objects of the given unit type. The
process starts with the root units, i.e. the ones that don't have a parent of the same type, and will traverse the
hierarchy tree for each of them. All changes to affected items are persisted.
generateUnitPaths(Class) and
saveChangesAndUpdateUnitPath(OrgUnitModel) are synchronized in order to avoid inconsistent
path values in case two threads try to access one of the methods at the same time.generateUnitPaths in interface OrgUnitHierarchyServiceunitType - Determines the type to generate path values for. Sub-types will be ignored. May not be
null.public void saveChangesAndUpdateUnitPath(OrgUnitModel unit)
OrgUnitModel and updates its path value as well as the
path values for all its descendants of the same type subsequently. All changes to affected
items are persisted.generateUnitPaths(Class) and
saveChangesAndUpdateUnitPath(OrgUnitModel) are synchronized in order to avoid inconsistent
path values in case two threads try to access one of the methods at the same time.saveChangesAndUpdateUnitPath in interface OrgUnitHierarchyServiceunit - The OrgUnitModel to update. May not be null.protected void updateUnitPath(OrgUnitModel unit)
protected java.util.Set<OrgUnitModel> generatePathForUnit(OrgUnitModel unit, OrgUnitModel parentUnit)
protected void beforeUpdate(OrgUnitModel unit, OrgUnitModel parentUnit)
protected void validatePath(OrgUnitModel parentUnit)
protected OrgUnitModel getParentUnit(OrgUnitModel unit)
protected java.util.Set<OrgUnitModel> getChildrenOfSameType(OrgUnitModel unit)
protected void handleTransactionException(java.lang.Exception e)
protected OrgUnitDao getOrgUnitDao()
public void setOrgUnitDao(OrgUnitDao orgUnitDao)
protected SessionService getSessionService()
public void setSessionService(SessionService sessionService)
protected ModelService getModelService()
public void setModelService(ModelService modelService)
Copyright © 2018 SAP SE. All Rights Reserved.