public function beforeSelect(\Slick\Orm\Events\Select $event)
    {
        if ($this->lazyLoad) {
            return;
        }
        $related = Entity\Manager::getInstance()
            ->get($this->getRelatedEntity());
        $relatedTable = $related->getEntity()->getTableName();
        $sql = $event->sqlQuery;
        $columns = $related->getColumns();
        $fields = [];
        foreach (array_keys($columns) as $column) {
            $name = trim($column, '_');
            $fields[] = "{$name} AS {$relatedTable}_{$name}";
        }
        $pmk = $related->getEntity()->getPrimaryKey();
        $ent = $this->getEntity()->getTableName();
        $clause  = "{$relatedTable}.{$pmk} = {$ent}.{$this->getForeignKey()}";
        $sql->join($relatedTable, $clause, $fields);
        $event->sqlQuery = $sql;
    }