public function buildQuery($overrideLimits = false)
{
$db = $this->getDbo();
$query = parent::buildQuery($overrideLimits);
// Wipe out select and from sections
$query->clear('select');
$query->clear('from');
$query->select($db->qn('node') . '.*')->from($db->qn($this->tableName) . ' AS ' . $db->qn('node'));
if ($this->treeNestedGet) {
$query->join('CROSS', $db->qn($this->tableName) . ' AS ' . $db->qn('parent'));
}
return $query;
}