public function configure($filename = null)
{
$this->_configFile = $filename;
$document = $this->loadXmlDocument($filename, $this);
foreach ($document->xpath('//property') as $property) {
$this->loadGlobalProperty($property);
}
foreach ($document->xpath('//typeHandler') as $handler) {
$this->loadTypeHandler($handler);
}
foreach ($document->xpath('//connection[last()]') as $conn) {
$this->loadDatabaseConnection($conn);
}
//try to load configuration in the current config file.
$mapping = new TSqlMapXmlMappingConfiguration($this);
$mapping->configure($filename);
foreach ($document->xpath('//sqlMap') as $sqlmap) {
$this->loadSqlMappingFiles($sqlmap);
}
$this->resolveResultMapping();
$this->attachCacheModels();
}