if (pinfo.isroot && pn == null)
if (pn == null && pinfo.isroot)
    public INode getParent () {	// check what's specified in the type.properties for this node.	ParentInfo[] parentInfo = null;	if (isRelational () && (lastParentSet < dbmap.getLastTypeChange() || lastParentSet < lastmodified))	    parentInfo = dbmap.getParentInfo ();	// check if current parent candidate matches presciption, if not, try to get it	if (parentInfo != null && state != TRANSIENT) {	    for (int i=0; i<parentInfo.length; i++) {	        ParentInfo pinfo = parentInfo[i];	        INode 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)	            pn = getNode (pinfo.propname, false);	        // the parent of this node is the app's root node...	        if (pinfo.isroot && pn == null)	            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 = pn.getNode (pinfo.virtualname, false);	            DbMapping dbm = pn == null ? null : pn.getDbMapping ();	            try {	                if (dbm != null && dbm.getSubnodeGroupby () != null) {	                    // check for groupby	                    rel = dbmap.columnNameToRelation (dbm.getSubnodeGroupby());	                    pn = pn.getSubnode (getString (rel.propName, false));	                }	                if (pn != null) {	                    setParent ((Node) pn);	                    anonymous = !pinfo.named;	                    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);    }