if ((parentInfo != null) && (state != TRANSIENT)) {
if (parentInfo != null) {
    public INode getParent() {        // check what's specified in the type.properties for this node.        ParentInfo[] parentInfo = null;        if (isRelational() &&                (lastParentSet < Math.max(dbmap.getLastTypeChange(), lastmodified))) {            parentInfo = dbmap.getParentInfo();        }        // check if current parent candidate matches presciption,        // if not, try to get one that does.        if ((parentInfo != null) && (state != TRANSIENT)) {            for (int i = 0; i < parentInfo.length; i++) {                ParentInfo pinfo = parentInfo[i];                Node pn = null;                // see if there is an explicit relation defined for this parent info                // we only try to fetch a node if an explicit relation is specified for the prop name                Relation rel = dbmap.propertyToRelation(pinfo.propname);                if ((rel != null) && (rel.reftype == Relation.REFERENCE ||                                      rel.reftype == Relation.COMPLEX_REFERENCE)) {                    pn = (Node) getNode(pinfo.propname);                }                // the parent of this node is the app's root node...                if ((pn == null) && pinfo.isroot) {                    pn = nmgr.getNode("0", nmgr.getDbMapping("root"));                }                // if we found a parent node, check if we ought to use a virtual or groupby node as parent                if (pn != null) {                    // see if dbmapping specifies anonymity for this node                    if (pinfo.virtualname != null) {                        pn = (Node) pn.getNode(pinfo.virtualname);                        if (pn == null)                            System.err.println("Error: Can't retrieve parent "+                                               "node "+pinfo+" for "+this);                    }                    DbMapping dbm = (pn == null) ? null : pn.getDbMapping();                    try {                        if ((dbm != null) && (dbm.getSubnodeGroupby() != null)) {                            // check for groupby                            rel = dbmap.columnNameToRelation(dbm.getSubnodeGroupby());                            pn = (Node) pn.getSubnode(getString(rel.propName));                        }                        if (pn != null && pn.isParentOf(this)) {                            setParent(pn);                            lastParentSet = System.currentTimeMillis();                            return pn;                        }                    } catch (Exception ignore) {                    }                }            }        }        // fall back to heuristic parent (the node that fetched this one from db)        if (parentHandle == null) {            return null;        }        return parentHandle.getNode(nmgr);    }