*/
private void addDeleteMethod(TopLevelClass topLevelClass,
IntrospectedTable introspectedTable)
{
Set<FullyQualifiedJavaType> importedTypes = new TreeSet<FullyQualifiedJavaType>();
Method method = new Method();
method.setVisibility(JavaVisibility.PUBLIC);
method.setName("delete");
FullyQualifiedJavaType type = new FullyQualifiedJavaType(
"java.io.IOException");
importedTypes.add(type);
method.addException(type);
method
.addBodyLine("Map<String, Object> json = DwzAjaxJsonUtil.getDefaultAjaxJson();");
method.addBodyLine("json.put(DwzAjaxJsonUtil.KEY_NAVTABID, navTabId);");
method.addBodyLine("json.put(DwzAjaxJsonUtil.KEY_CALLBACKTYPE, \"\");");
method.addBodyLine("if(" + recordLowerFullType + " == null){");
method.addBodyLine("json.put(DwzAjaxJsonUtil.KEY_STATUSCODE, 300);");
method.addBodyLine("json.put(DwzAjaxJsonUtil.KEY_MESSAGE, \"操作失败!\");");
method.addBodyLine("}else{");
method.addBodyLine(serviceObjName + ".delete(" + recordLowerFullType
+ ");");
method.addBodyLine("}");
method.addBodyLine("super.writeMap(json);");
topLevelClass.addImportedTypes(importedTypes);
topLevelClass.addMethod(method);
}