/** Polymorphism support: $peanut has been initialized from data, but
	* some field values where not in the data. Probably the query the data 
	* was retrieved with, was created by a superclass' classDescriptor.
	* run another query to retrieve the missing data and initialize 
	* the peanut from it.
	* PRECONDITION: $delegator not null
	* @param PntDbObject The peanut that is being retrieved
	* @param integer $id The id of the object
	* @param Array $missingFieldsMap With names of missing fields as keys and columnNames as values
	* @param PntClassDescriptor $delegator The classDescriptor that issued the original query that resulted in delegation and missing fields
	* @throws PntError
	*/
	function loadMissingFields($peanut, $id, &$missingFieldsMap, $delegator) {
		//collect maps for missing tables and fields 
		$delegatorTableMap = $delegator->getTableMap();
		$ownTableMap = $this->getTableMap();
		$missingTableMap = array();
		$fieldMapPrefixed = array();
		forEach($missingFieldsMap as $field => $columnName) {
			$prop = $this->getPropertyDescriptor($field);
			$tableName = $prop->getTableName();
			if (!isSet($delegatorTableMap[$tableName]) ) {
				$missingTableMap[$tableName] = $ownTableMap[$tableName];
				$fieldMapPrefixed[$field] = $tableName. ".". $columnName;
			}
		}
		if (count($fieldMapPrefixed) == 0) return; //assume some of the fields that are normally retrieved by the delegator where left out deliberately

		//there still are fields to retrieve, build query
		$qh = $this->getSelectQueryHandlerFor($this->getTableName(), $missingTableMap, $fieldMapPrefixed);
		$qh->where_equals(key($missingTableMap).'.id', $id);

		$qh->runQuery();
		if ($qh->getError())
			throw new PntReflectionError($qh->getError(), $qh->getErrNo());
		$row = $qh->getAssocRow(); 
		$qh->release();
		if (!$row) 
			throw new PntReflectionError($this. "no rows when loading missing fields of: ". $peanut->getLabel());
		$peanut->initMissingFields($peanut->initFromData($row, $missingFieldsMap));
	}