protected function queryAddPrimaryKeyWhere($query, $id, $clause = 'where')
	{
		$table = $query->quoteIdent($this->table_alias ? $this->table_alias : $this->table);

		if ($id === null || $id === array() || $id === false || $id === '') {
			throw new InvalidArgumentException('Empty ID.');
		} else if (count($id) != count($this->describeId())) {
			throw new InvalidArgumentException(sprintf('Malformed ID: got %d pieces of %d.', count($id), count($this->describeId())));
		}
		foreach (array_combine($this->describeId(), (array) $id) as $col => $val) {
			$query->$clause($table.'.'.$query->quoteIdent($col).' = ?', $val);
		}
		return $query;
	}