code: private void validateIfRequiredByParent(JDBCStorageConnection conn, ResultSet resultSet) throws RepositoryException,
        SQLException, IllegalNameException
     {
        String parentId = getIdentifier(resultSet, DBConstants.COLUMN_PARENTID);
        InternalQName nodeName = InternalQName.parse(resultSet.getString(DBConstants.COLUMN_NAME));
  
        NodeData parent = null;
        try
        {
           parent = (NodeData)conn.getItemData(parentId);
        }
        catch (PrimaryTypeNotFoundException e)
        {
           // It is possible, parent also without primaryType property
           return;
        }
  
        // parent already removed in previous check
        if (parent == null)
        {
           return;
        }
  
        NodeDefinitionData def =
           nodeTypeManager.getChildNodeDefinition(nodeName, parent.getPrimaryTypeName(), parent.getMixinTypeNames());
  
        if (!def.isResidualSet())
        {
           throw new SQLException("Node is required by its parent.");
        }
     }
docs: Validates if node represented by instance of {@link ResultSet} is mandatory
  for parent node. It means should not be removed. Throws {@link SQLException}
  in this case with appropriate message.