public function refMapToOnClause($refModel, $thisAlias = null, $refAlias = null) {
        $thisAlias   = $thisAlias ?: $this->getName();
        $thisAdapter = $this->getAdapter();
        $thisAlias   = $thisAdapter->quoteIdentifier($thisAlias);

        $ref        = $this->getReference($refModel);
        $refModel   = new $refModel();
        $refAdapter = $refModel->getAdapter();
        $refAlias   = $refAlias ?: $refModel->getName();
        $refAlias   = $refAdapter->quoteIdentifier($refAlias);

        $on = array();
        foreach ($ref['columns'] as $i => $col) {
            $col = $thisAdapter->quoteIdentifier($col);
            $refCol = $refAdapter->quoteIdentifier($ref['refColumns'][$i]);
            $_on = "{$thisAlias}.{$col} = {$refAlias}.{$refCol}";
            $on[] = $_on;
        }

        $on = implode(' AND ', $on);
        return $on;
    }