private void replaceExpenMetric(DirectoryEntity entityWhat, DirectoryEntity entityWith) {
//ExpenditureType
List entityList = findEntityList(ExpenditureType.class, "expenditureMetric", entityWhat);
for (int i = 0; i < entityList.size(); i++) {
ExpenditureType expenditureType = (ExpenditureType)entityList.get(i);
expenditureType.setMetric((ExpenditureMetric) entityWith);
manager.merge(expenditureType);
}
removeEntity(entityWhat);
manager.flush();
}