protected function _addCompound($type, Query $query) {
        if ($query->getType() !== self::SELECT) {
            throw new InvalidQueryException(sprintf('Only a select query can be used with %s', $type));
        }

        $query->attribute('compound', $type);

        $this->_compounds[] = $query;

        return $this;
    }