summaryrefslogtreecommitdiff
path: root/framework/Data/SqlMap/Configuration
diff options
context:
space:
mode:
authorwei <>2006-12-17 22:20:50 +0000
committerwei <>2006-12-17 22:20:50 +0000
commit2570226fbac3e26b1e94896b50d1db4bc1aa3308 (patch)
tree421108ccbdc0ef021e6af4fa35b1d6bcbc352b37 /framework/Data/SqlMap/Configuration
parentddc0de38f64e5834ce04f0407a8416172b596655 (diff)
Add TDataSourceConfig, TSqlMapConfig, TActiveRecordConfig
Diffstat (limited to 'framework/Data/SqlMap/Configuration')
-rw-r--r--framework/Data/SqlMap/Configuration/TSqlMapStatement.php28
-rw-r--r--framework/Data/SqlMap/Configuration/TSqlMapXmlConfiguration.php13
2 files changed, 26 insertions, 15 deletions
diff --git a/framework/Data/SqlMap/Configuration/TSqlMapStatement.php b/framework/Data/SqlMap/Configuration/TSqlMapStatement.php
index 253d2090..5d2640e9 100644
--- a/framework/Data/SqlMap/Configuration/TSqlMapStatement.php
+++ b/framework/Data/SqlMap/Configuration/TSqlMapStatement.php
@@ -295,6 +295,22 @@ class TSqlMapStatement extends TComponent
}
/**
+ * TSqlMapSelect class file.
+ *
+ * @author Wei Zhuo <weizho[at]gmail[dot]com>
+ * @version $Id$
+ * @package System.Data.SqlMap.Statements
+ * @since 3.1
+ */
+class TSqlMapSelect extends TSqlMapStatement
+{
+ private $_generate;
+
+ public function getGenerate(){ return $this->_generate; }
+ public function setGenerate($value){ $this->_generate = $value; }
+}
+
+/**
* TSqlMapDelete class corresponds to the <delete> element.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
@@ -339,18 +355,6 @@ class TSqlMapInsert extends TSqlMapStatement
}
/**
- * TSqlMapSelect class corresponds to <select> element.
- *
- * @author Wei Zhuo <weizho[at]gmail[dot]com>
- * @version $Id$
- * @package System.Data.SqlMap.Configuration
- * @since 3.1
- */
-class TSqlMapSelect extends TSqlMapStatement
-{
-}
-
-/**
* TSqlMapUpdate class corresponds to <update> element.
*
* @author Wei Zhuo <weizho[at]gmail[dot]com>
diff --git a/framework/Data/SqlMap/Configuration/TSqlMapXmlConfiguration.php b/framework/Data/SqlMap/Configuration/TSqlMapXmlConfiguration.php
index eccf4f6e..d92a0f07 100644
--- a/framework/Data/SqlMap/Configuration/TSqlMapXmlConfiguration.php
+++ b/framework/Data/SqlMap/Configuration/TSqlMapXmlConfiguration.php
@@ -180,6 +180,10 @@ class TSqlMapXmlConfiguration extends TSqlMapXmlConfigBuilder
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);
@@ -222,9 +226,12 @@ class TSqlMapXmlConfiguration extends TSqlMapXmlConfigBuilder
*/
protected function loadSqlMappingFiles($node)
{
- $mapping = new TSqlMapXmlMappingConfiguration($this);
- $filename = $this->getAbsoluteFilePath($this->_configFile, (string)$node['resource']);
- $mapping->configure($filename);
+ if(strlen($resource = (string)$node['resource']) > 0)
+ {
+ $mapping = new TSqlMapXmlMappingConfiguration($this);
+ $filename = $this->getAbsoluteFilePath($this->_configFile, $resource);
+ $mapping->configure($filename);
+ }
}
/**