public function getFields() {
        $fields = $this->_fields;

        if ($this->getJoins() && !$fields && $this->getType() === self::SELECT) {
            return array_keys($this->getRepository()->getSchema()->getColumns());
        }

        return $fields;
    }