}
}
}
public <T extends ApiPropertyBase> void deleteChildren(List<ObjectReference<T>> childs, Class<?> childCls, StringBuffer syncLogMesg) throws Exception {
final ApiConnector api = _manager.getApiConnector();
if (childs == null) {
syncLogMesg.append("no children of type: " + childCls.getName() + "\n");
return;
}
syncLogMesg.append("delete children of type : " + DBSyncGeneric.getClassName(childCls) + "\n");
String deleteChildMethod = "delete" + DBSyncGeneric.getClassName(childCls);
Method method = null;
Method methods[] = this.getClass().getMethods();
for (int i = 0; i < methods.length; i++) {
if (methods[i].getName().equalsIgnoreCase(deleteChildMethod)) {
method = methods[i];
break;
}
}
int count = 0;
for (ObjectReference<T> childRef : childs) {
@SuppressWarnings("unchecked")
ApiObjectBase child = api.findById((Class<? extends ApiObjectBase>)childCls, childRef.getUuid());
if (method != null) {
method.invoke(this, child, syncLogMesg);
} else {
deleteDefault(child, childCls, syncLogMesg);
}