added null check for Parent_ID element.

This commit is contained in:
Heng Sin Low 2010-12-24 11:55:02 +08:00
parent 7d4f9afb08
commit cc04468c7d
1 changed files with 11 additions and 9 deletions

View File

@ -106,12 +106,14 @@ public class MenuElementHandler extends AbstractElementHandler {
Element parentElement = element.properties.get("Parent_ID");
int parentId = 0;
if (parentElement != null) {
if (ReferenceUtils.isIDLookup(parentElement) || ReferenceUtils.isUUIDLookup(parentElement)) {
parentId = ReferenceUtils.resolveReference(ctx, parentElement);
} else {
String parent = getStringValue(element, "Parent_ID");
parentId = findIdByName(ctx, "AD_Menu", parent);
}
}
StringBuffer updateSQL = null;
String sql = "SELECT count(Parent_ID) FROM AD_TREENODEMM WHERE AD_Tree_ID = 10"