public function findBySql($sql,$params=array())
	{
		Yii::trace(get_class($this).'.findBySql()','system.db.ar.CActiveRecord');
		$this->beforeFind();
		if(($criteria=$this->getDbCriteria(false))!==null && !empty($criteria->with))
		{
			$this->resetScope(false);
			$finder=$this->getActiveFinder($criteria->with);
			return $finder->findBySql($sql,$params);
		}
		else
		{
			$command=$this->getCommandBuilder()->createSqlCommand($sql,$params);
			return $this->populateRecord($command->queryRow());
		}
	}