public function with(array $related)
    {

        $relations = $this->getEntityObject()->getRelations();
        foreach ($relations as $fk => $target) {
            $table = strstr($target, '.', true);

            if (in_array($table, $related)) {

                $this->sql(" ,$table.*");
                $this->join($table, "$this->oosql_table.$fk = $target");
            } elseif (isset($related[$table])) {

                foreach ($related[$table] as $field) {
                    $this->sql(" ,$table.$field");
                }
                $this->join($table, "$this->oosql_table.$fk = $target");
            }
        }
        return $this;
    }